国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

Transformation Rule(邏輯實現成關系表的規則)

2024-07-21 02:06:12
字體:
來源:轉載
供稿:網友
國內最大的酷站演示中心!

word underlined is primary key
rule 1.each entity in an e-r diagram is mapped to a single table in a relational database;the table is name after the entity.the columns of the table represent all the single-valued simple attributes that are attached to the entity(possibly through a composite attribute,although a composite attribute itsself does not become a column of the table)。

rule2:given an entity e with primary identifier p,a multi-valued attribute a attached to e in an e-r diagram is mapped to a table of its own;the table is named after the plural multi-valued attribute.the columns of this new table are named after p and a,and rows of the table correspond to (p,a) value pairs,representing all pairings of attribute values of a associated with entity occurrences in e.the primary key attribute for this table is the set of columns in p and a.
eg: (here p = = eid,a == hobby)
employes(eid,staddress,city,states,zipcodes) (197,7 beacon,boston,ma,02102) (221,19 brighton st,boston,ma,02103)
hobbies(eid,hobby) (197,chess)(197,painting)(221,reading)

rules3:n-n relationships.when two entities e and f take part in a many-to-many binary relationship r,the relationship is mapped to a representative table t in the related relational database design.the table contains columns for all arrtibutes in the primary keys of both tables transformed from entities e and f,and this set of columns forms the primary key for the table t.
eg:(employees -(1,n)-works_on-(0,n)-projects        ---n-n(many-to-many) )
employees(eid,straddr,city,state,zipcode)  --woks_on(eid,prid,percent) --projects(prid,proj_name,due_date)

rules4:n-1 relationships.when two entities e and f take part in a many-to-one binary relationship r,the rlationship will not be mapped to a table of its own in a relational database design.instead,if we assume that the entity f has max-card(f,r)=1 and thus represents the “many“ side of the relationship,the relational table t transformed from the entity f should include colums constituting the primary key for the table transformed from the entity e;this is known as a foreign key in t.
eg:instructors(insid,lname,office_no,ext)  -- cours_sections(secid,insid,course,room,preriod).

rules5:1-1 relationships,optional participation.given two entities e and f that take part in a one-to-one binary relationship r,where participation is optional on either side,we wish to translate this situation into a relaional design  -- use foreign key on either or both sides.

rules6:1-1 relationships,mandatory participation on both sides. in the case of a one-to-one relationship with mandatory particpation on both sides,it is most appropriate to combine the tables for the two entities into one,and in this way avoid any foreign keys. 

 

 

 

 

 

 

 

 

 

 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 三门县| 洞口县| 玉环县| 巍山| 漳浦县| 长兴县| 海南省| 正镶白旗| 穆棱市| 玛纳斯县| 济宁市| 基隆市| 贵溪市| 沅江市| 兴业县| 南木林县| 三亚市| 沾益县| 孝义市| 泰兴市| 乌拉特前旗| 花莲县| 西安市| 航空| 汉沽区| 龙口市| 马龙县| 河间市| 栖霞市| 黄山市| 鄱阳县| 雷山县| 卫辉市| 深圳市| 象山县| 延边| 大安市| 定远县| 樟树市| 亳州市| 桐柏县|