当前位置:网站首页>Er and eer models
Er and eer models
2022-04-23 02:57:00 【Senior agent of Sarkozy】
The idea of this paper mainly comes from Luo Hao jackfrued The teacher's online class
For my study reference only , Not used for other purposes !
Readers are also advised to learn through the teacher's course .
Introduce
Why would there be ER Map and EER Existence of graph ?
** Really do the project 、 When designing a database ,** It's not that simple , For example, many users can't see 、 But for convenience DBA Fields created using . Such as id, There are usually two Date Field ( A indicates when the record was created , Two indicates the last update time of this record ), And reserve a VARCHAR / json Field ; There are other considerations ( such as auto-increment Constraints are not commonly used in development , Use more algorithms, such as distributed ID generating algorithm ( Such as SnowFlake……) Of course, this is not important for the course ) It's impossible to write as soon as you come up SQL Of the statement , You need to design the structure of the table and the relationship between the tables first .
ER Model
ER chart (Entity Relationship, Entity relations ) So there comes . Here is a ER An example of a graph , The rectangular box represents : surface ( That's entity ), The oval box represents : Fields in the table ( Properties of entities ), The diamond box represents : Relationship , The multiplicity of the relationship is indicated on the connecting line .
Compared with a large section of SQL Create table statement , As long as you can understand ER chart , The structure of the table 、 The relationship is clear at a glance .
EER Model
Comparison ER The model has more generalization levels 、 Aggregation hierarchy 、 Concepts such as weak entities .
Generalization hierarchy
Include generalization and specialization ( Generalization and specialization )、 Parent class (superclass) And subclasses (subclass) The concept of .
Subclass parent class Just like that. Java Inheritance , If animals are the parent , cat 、 Dogs are a subclass .
generalization Also called induction , Is to extract the common attributes of several classes as the parent class ;
specialized Also known as deduction , Is to add their own special attributes as subclasses on the basis of the parent class .
among , Subclasses and superclasses have two relationship attributes :mandatory and optional、disjoint and overlapping.
mandatory / optional: All attributes in the parent class must be contained in each subclass / Don't inherit all , Select partial inheritance ( Completeness limitation )
disjoint / overlapping: Whether there can be intersecting properties between several subclasses inheriting the same parent class ( Intersection restrictions )
In the figure The transportation tool is the parent class , The plane 、 train 、 Cars are a subclass . Write... In the circle D / O, Express disjoint / overlapping. There is a double solid line between the parent class and the circle , Said is mandatory Complete inheritance .
Aggregation hierarchy
Aggregation, The collection hierarchy is no longer different from the parent and child classes , But by the …… The difference in composition .
Pictured , room 、 doors and windows 、 The computer 、 The projector is an integral part of the classroom , It's not inheritance .
Weak entity
One entity is meaningful only when another entity exists . Such as parents and children , Without one side, the other side is meaningless .
Workbench And other tools support painting ER chart , Even after drawing, it can be automatically generated SQL Statement table building . Workbench The picture in is EER chart ( Extended ER chart )
stay EER Below , Click on DATABASE - FORWARD ENGINEER Forward engineering , You can select the table to generate 、 Field , Generate SQL Statement creation table .
Automatically generated SQL In the sentence , There are two sentences below the foreign key ON DELETE NO ACTION
ON UPDATE NO ACTION
, Meaning for : When the primary key of the foreign key reference is modified / deleted , How will the table where the foreign key is located be affected ?—— Take no action . It is suggested to remove these two sentences . If you remove , You can't just modify / Delete the primary key used by the foreign key .
similarly , stay SQL Statement page , Click on DATABASE - REVERSE ENGINEER Reverse Engineering , Can be generated according to the structure of the table EER chart .
Power Designer Modeling tools , Also support positive / Reverse Engineering , Can generate SQL dialect . Full version paid .
版权声明
本文为[Senior agent of Sarkozy]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220647385077.html
边栏推荐
- First knowledge of C language ~ branch statements
- Traversée de l'arbre L2 - 006
- 进阶上将程序员必备素质
- Basic workflow of CPU
- Actual combat of industrial defect detection project (IV) -- ceramic defect detection based on hrnet
- 学习正则表达式选项、断言
- Classification of technology selection (2022)
- The penultimate K nodes in jz22 linked list
- win查看端口占用 命令行
- Numpy stack function
猜你喜欢
Airtrack cracking wireless network password (Dictionary running method)
Configuring Apache Web services for servers such as Tianyi cloud
The way to conquer C language
Depth deterministic strategy gradient (ddpg)
Encapsulation of ele table
Flink learning (XI) watermark
tf. keras. layers. Timedistributed function
Innovation and management based on Scrum
[unity3d] rolling barrage effect in live broadcasting room
Introduction to ACM [inclusion exclusion theorem]
随机推荐
基于Scrum进行创新和管理
Centos7 install MySQL 8 0
Domestic lightweight Kanban scrum agile project management tool
How to use C language to realize [guessing numbers game]
B blocks of the 46th ICPC Asian regional competition (Kunming)
AC380V drop 5v12v24v200ma, UHV non isolated chip IC scheme
tf. keras. layers. Embedding function
Six very 6 computer driver managers: what software is good for driver upgrade? Recommended by the best computer driver management software abroad
Huawei machine test question -- deformation of hj53 Yang Hui triangle
Navicat failed to connect to Oracle Database: cannot load OCI DLL, 87: instant client package is
Table space capacity query and expansion of Oracle Database
BLDC double closed loop (speed PI + current PI) Simulink simulation model
Essential qualities of advanced programmers
Classification of technology selection (2022)
leangoo脑图-共享式多人协作思维导图工具分享
Store consumption SMS notification template
First knowledge of C language ~ branch statements
The shell monitors the depth of the IBM MQ queue and scans it three times in 10s. When the depth value exceeds 5 for more than two times, the queue name and depth value are output.
接口请求时间太长,jstack观察锁持有情况
Introduction to ACM [inclusion exclusion theorem]