当前位置:网站首页>Overview of database system -- overview of data model
Overview of database system -- overview of data model
2022-07-18 12:04:00 【Climbing procedural ape】
Non software major , I have always felt it difficult to convert the demand to the data of the provincial database , The data model part in the overview of database system speaks well about this part , Sort out and record .
When converting requirements into tables in the database and files on the operating system , It roughly goes through the following steps , demand -> conceptual model -> Data model supported by database management system -> The physical model ( Physical file )

conceptual model
It is used for modeling the information world , The language of communication between database designers and users , Need strong semantic expression ability , Simple 、 Clear 、 Easy for users to understand , The expression method is ER chart ,EA The tool DataBaseEngine->EntityRelationShip,

ER The graph has entities 、 Attribute and connection are three parts
Entity : Transactions that exist and can be distinguished from each other , It can be human. 、 things 、 Things or abstract concepts , Because it can be distinguished , There must be a unique key , Namely code
attribute : That is, the attribute of the entity
contact : The connection within the entity ( Not yet learned )、 Connection between entities 1:1 1:n m:n


logical model
The logical model is through structure 、 operation 、 Integrity constraint expression Of ,
structure : Describe the constituent objects of the database ( Include type 、 Content 、 nature ), And the connection between objects ( Set up Type, That is, the ownership relationship ), Is a static description

operation : Add, delete, modify and check the object , Allow those , Consider querying and updating ( Additions and deletions ) that will do , Dynamic description
Integrity constraints : A set of integrity rules , Integrity rules : Constraints and dependency rules of data and its relationships in a given data model , It is used to define the state of the database in accordance with the data model and the change of the state , To make sure the data is correct 、 Effective and compatible , It is divided into basic general constraints and constraints that need to be used in specific applications .
The types of logical models are hierarchical model 、 Mesh model 、 relational model 、 Object oriented model 、 Object relational data model 、 Semi structured data model 、 Unstructured data model , The hierarchical and mesh models are formatted models , Use hierarchical connection description , Outdated .
hierarchical model
The hierarchical model uses A tree structure To represent all kinds of entities and the relationships between them ,XML Language , The set of basic hierarchical relations satisfying the following two conditions is a hierarchical model
1. There is only one node without parents , This node is called the root node
2. A node other than the root has and only one parent node
structure :


Operational and integrity constraints : Constraints can be handled with foreign keys
- Without the corresponding parent node value, the child node value cannot be inserted , Only one root node , If there is no parent node , You can't insert
- If you delete the parent node value , The corresponding child node values are also deleted
- When updating operation , All corresponding records should be updated , To ensure data consistency
shortcoming :
- Cannot achieve many to many problems
- There are many insert and delete operations , Query child nodes can only be downward through parents layer by layer
Mesh model
Solve the single root node of hierarchy , That is, more than one node is allowed to have no parents ( Multiple root nodes ), Solved the problem that the hierarchy cannot specify multiple parents , That is, find from multiple paths , Solve many to many problems .

a key : Many to many problems can be solved by decomposing into one to many connections
EA The tool DataModel chart , The following decomposes the many to many relationship between students and courses into the following one to many relationship .

Operations and constraints :
(1) Must have the concept of code , Because there is no root
(2) Ensure that the parent node and child node are in a one to many relationship , It is convenient to layer the network
(3) There are constraints on the relationship between parent nodes and child nodes , That is, the problem of nationality , The existence of parents is required to insert child nodes , Delete parent node , Child nodes must also be deleted , For example, course selection must rely on the existence of both students and courses to insert , When deleting a student , Students' relevant elective courses have to be deleted .
shortcoming
(1) Complicated structure , Difficult to understand
(2) Use data according to 1 Find multiple paths , You have to follow the path
relational model
A relationship is a table , Contains tuples ( a line ), attribute ( Column )、 Main code ( A tuple can be uniquely determined )、 Domain ( Property value range ).
Standard conditions :
(1) Each component of a relationship must be an indivisible data item , It is not allowed to have tables in the table
Salary in the subscript , Including basic salary , Job pay , Performance allowances , It's a little watch , Deduction is the same small table .

advantage :
(1) The operation objects are all relations
(2) Hidden path , Easy to use
shortcoming :
Access path is transparent to users , Query efficiency is often not as efficient as the formatted data model
To improve performance , The user's query request must be optimized , It increases the difficulty of developing database management system
边栏推荐
- redis数据类型
- Assembly language instruction Encyclopedia
- 私域运营为啥这么火?企业如何做好自己的私域运营呢?
- UE4_UE5播放音频(播放、停止功能)(附工程)
- YGG established a new subdao - YGG Japan
- Completion report of communication software development and Application
- DDD Domain Driven Design
- [C language] string function and memory operation function
- Solve the "cannot find module 'path' or its corresponding type declarations." in TS
- Four reasons for programmers' headaches | daily anecdotes
猜你喜欢

利用Mysql+Excel处理数据

程序员头疼的 4 种原因 | 每日趣闻

解决 : ReferenceError: PubSub is not defined

uniapp uni-popup change

Pule frog 4d5d dynamic cinema | VR space travel equipment | VR takes you to travel in space

Surpass traditional giants and take the top place in the list of senior engineers! What does this local enterprise rely on?

tmux使用

每日学习Redis——拿捏Redis中的通用指令(键和数据库通用指令)

数据库系统概率 -- 关系型数据库

Mid platform construction sharp weapon SPI plug-in mechanism
随机推荐
洛谷题单-高精度
GDB常用指令
免费SSL证书申请及部署实践
Delete After the idea directory, the SVN menu resumes operation
一道极限题目
移动机器人学(二)姿态解算
thinkphp 代码执行 (CNVD-2018-24942)
Power bi---- DAX explanation
YGG 成立了新的 SubDAO——YGG日本
为什么说大公司不是天堂,里面有哪些坑?
包含数字的字符串剔除字母根据步长递增
Unity-NGUI的Prefab迁移到其他工程时脚本丢失解决办法
Hidden Markov model (HMM)
[LSTM regression prediction] Based on MATLAB tpa-lstm time attention mechanism, long-term and short-term memory neural network regression prediction (multiple input and single output) [including Matla
Common audio features: Mel spectrum, amplitude spectrum (short time Fourier transform spectrum /stft), Mel cepstrum (MFCC)
Redis data type
迁移学习模型训练一
Leetcode 196 Delete duplicate email (2022.07.15)
Network security serves national strategic needs
PDB 常用命令