数据库——由ER图转换为关系映射的方法
来源:互联网 发布:国外的即时通讯软件 编辑:程序博客网 时间:2024/04/19 17:50
数据库——由ER图转换为关系映射的方法
具体步骤:
1.For each strong entity type E. Create a new table. Include as its columns, all the simple attributes and simple components of the composite attributes of E. Identify the primary key and the alternate keys. Do not include any multi-valued attribute as a key. If the only unique field of an entity is a multi-valued attribute, introduce an artificial primary key field.
强实体类型的映射:实体E转换成关系R,R中包含有中所有的简单属性。对于复合属性,将其复合转换成简单属性。
2.For each weak entity W that is associated with only one 1:1 identifying owner relationship. Identify the table T of the owner entity type. Include as columns of T, all the simple attributes and simple components of the composite attributes of W.
3.For each weak entity W that is associated with a 1:N or M:N identifying relationship, or participates in more than one relationship. Create a new table T. Include as its columns, all the simple attributes and simple components of the composite attributes of W. Form the primary key of T as follow: In the case of a 1:N owner relationship, by including as a foreign key in T, the primary key of the owner entity. The primary key of T is the combination of W’s partial key and the foreign key. In the case of a M:N owner relationship, by creating a new column that will hold unique values. (In this case, the association between the weak entity and its owner entity will be specified in Step 6.)
4.For each binary 1:1 relationship type R. Identify the tables S and T of the participating entity types. Choose S (preferably the one with total participation). Include as foreign key in S, the primary key of T. Include as Columns of S, all the simple attributes and simple components of the composite attributes of R.
二元关系1:1的映射:实体A和B为1:1,两个实体分别对应的关系为R和S,在关系R中使用S的主键为外键,在S中使用R的主键为外键。
5.For each binary 1:N relationship type R. Identify the table S (at the N-side) and T of the participating entities. Include as a foreign key in S, the primary key of T. Include as columns of S, all the simple attributes and simple components of composite attributes of R.
二元关系1:N的映射。实体A和B为1:n,两个实体分别对应的关系为R和S,标示S为n的一端,在S中使用R为外键,主键为S的主键。
6.For each N-ary relationship (including binary N:M relationship) type R. Create a new table T. Include as columns of T, all the simple attributes and simple components of composite attributes of R. Include as foreign keys, the primary keys of the participating (strong or weak) entity types. Specify as the primary key of T, the list of foreign keys.
二元关系M:N的映射。实体A和B为m:n,两个实体分别对应的关系为R和S,则为M:N创建一个新的关系T,在T中使用R和S的主键的组合为T的主键
7.For each multi-valued attribute A. Create a new table T. Include as columns of T, the simple attribute or simple components of the attribute A. In table T, include as foreign key, the primary key of the entity or relationship type that has A. Specify as the primary key of T, the foreign key and the columns corresponding to A.
多值属性A的映射。为每个多值属性创建一个新的关系R。R中包含A相对应的一个属性,另外还包括该A所在实体的主键K。R的主键由A,K的组合
8.For each specialization with disjoint subclasses. Create a new table Ti for each subclass Si. Include as columns of Ti, the simple attributes and simple component attributes of the superclass. Include as columns of Ti, the simple attributes and simple component attributes specific to Si. Identify the primary key.
9.For each specialization with overlapping subclasses. Create a new table O for the superclass. Include as columns of O, the simple attributes and the simple component attributes of the superclass. Identify its primary key and alternate keys. Create a new table Ti for each subclass Si. Include as columns of Ti, the simple attributes and simple component attributes specific to Si. Include as a foreign key in Ti (to be part of the primary key of Ti), the primary key of O.
- 数据库——由ER图转换为关系映射的方法
- 关于由ER模型转换为关系模型的方法和步骤
- ER-关系映射方法
- 数据库系统原理——ER图转换成关系模式集的算法
- 【数据库】ER图转换成关系模式集的算法
- 【数据库设计】逻辑设计-ER模型转换为关系模型
- ER图转换关系模式
- 最后那3分——ER模型到关系模型的转换
- 数据库系统原理——ER模型与关系模型
- 数据库系统原理——ER模型与关系模型
- 如何把ER模型转换为关系模型
- MySql (四) ER图与实体关系映射
- 机房重构之EA中的ER图转换为数据库
- ER 和 数据库关系模式
- CACTI流量监控由bit转换为M的方法
- 如何将ER图转换成关系模式集
- 一种XML文档和关系数据库的映射方法
- MYSQL数据库由latin1转换为utf8
- centos搭建gitlab服务器
- 关于上架App Store 的问题汇总
- 湖南房卡跑胡子棋牌源码,娄底跑胡子\衡阳跑胡子\怀化跑胡子\湘乡跑胡子
- HDU-1242 Rescue
- LD_LIBRARY_PATH .
- 数据库——由ER图转换为关系映射的方法
- ftp服务器搭建
- python简介
- JNI、NDK相关技术学习及使用方法
- 出现 command not found,怎么办???
- Struts2中对Servlet API的访问
- Acegi (Spring Security)入门
- ARM基础学习-Cache和写缓冲器
- jQuery中this与$(this)的区别总结