SlideShare una empresa de Scribd logo
1 de 10
CH4 Relational Mappong
步驟一:將各個實體畫出,並加上屬性,並將主鍵標為 PK ( 組合屬性為 Name 、 Fname 、 Minit 、 Lname ,則 Name 不需要加上去,如上所示 ) Employee Ssn Bdate Name Fname Minit Lname Address Salary Sex Employee Eependents_of Dependents_of 1 N Name Sex Birth_date Relationship PK Supervision 1  Supervisor N  Superises Sex Salary Address Bdate Ssn Lname Minit Fname
Employee FK PK 步驟二:將弱實體前,加上強實體的主鍵,成為外來鍵 步驟三:下頁說明->為了配合圖形,先說明步驟四 步驟四:若有 1:N 時,將 1 那邊實體的主鍵, 加到 N 那邊成為外來鍵 ( 若是遞迴關係,則將主鍵從新命名, 原因:為了避免在同一個欄位出現兩個相同的 ssn) FK PK PK ( 因此原本是 ssn ,從新命名後變成 Super_ssn) Employee Dependent 請參考前一頁投影片上的 ER 圖 Sex Salary Address Bdate Ssn Lname Minit Fname Relationship Birth_date Sex Name Employee_ssn Super_ssn Sex Salary Address Bdate Ssn Lname Minit Fname
Department Name Locations Number Manages 1 1 步驟三: 1 對 1 時,將任一個實體的主鍵 加到另一邊上,成為外來鍵 PS :若是如上圖所以,有一邊是完全參予 的話,則將 1 條線上實體的主鍵,加 到 2 條線時那邊成為外來鍵 PK FK Department 如上圖,將 employee 的主鍵 放到 department 當外來鍵 Number Name Employee_ssn
[object Object],Works_on Project N M Location Number Name Hours Works_on FK Project FK PK Hours Project_name Employee_ssn
Locations 步驟六: 如下圖 ,將多值屬性再創一個關連表, 且把自身當成外來鍵 ( 例: Locations_ 名稱 ) ,再加上原實體的主鍵形成外來鍵, 兩個外來鍵合成一個主鍵 R1 E1 E2 E3 e1 e2 e3 r1 步驟七: 如上圖 多元關係,將關係轉變成新的 關聯表,並將關係上連結的實體的主鍵 放上去變成外來鍵,外來鍵加起來就是主鍵 FK FK PK Locations_ 名稱 Department_name
[object Object],[object Object],[object Object],[object Object],E1 E3 E2 E0 e1 e2 e3 eo d e1 eo e2 eo eo e3 eo PK FK PK PK PK FK FK 步驟八:主類別、次類別 將實體和實體上的屬性畫出來,並在子類別加上超類別的主鍵 Step 8: Options for Mapping  Specialization  or  Generalization
[object Object],[object Object],[object Object],E1 E9 E2 u a1 a2 b1 b2 e9 e9 e9 b2 b1 a1 a2 步驟九 A :若兩實體均沒有共同屬性,則 實體 E9 產生一個屬性,並在 E1 和 E2 加上成為外來鍵 FK FK e9 PK Step 9: Mapping of Union Types ( Categories )
[object Object],[object Object],[object Object],E3 E10 E4 ∩ c2 c1 u1 d2 d1 u1 ee2 c1 c2 u1 u1 d2 d1 u1 ee2 FK 步驟九 B :若兩實體有共同屬性,則 實體 E10 抓住共同屬性 來當外來鍵 Step 9: Mapping of Union Types ( Categories )
大 家 加 油 如有錯誤,請提出指教 ~

Más contenido relacionado

Destacado (12)

Sql指令 2
Sql指令 2Sql指令 2
Sql指令 2
 
imaginatie
imaginatieimaginatie
imaginatie
 
Database Ch2
Database Ch2Database Ch2
Database Ch2
 
Sql Server2005 安裝2
Sql Server2005 安裝2Sql Server2005 安裝2
Sql Server2005 安裝2
 
Mini Guida Berlino
Mini Guida BerlinoMini Guida Berlino
Mini Guida Berlino
 
EMOTIE DE TOAMNA-1224312917278465-8
EMOTIE DE TOAMNA-1224312917278465-8EMOTIE DE TOAMNA-1224312917278465-8
EMOTIE DE TOAMNA-1224312917278465-8
 
Crizanteme
CrizantemeCrizanteme
Crizanteme
 
Il2008 Fostering Innovation Presentation
Il2008 Fostering Innovation PresentationIl2008 Fostering Innovation Presentation
Il2008 Fostering Innovation Presentation
 
Il2008 Fostering Innovation Presentation
Il2008 Fostering Innovation PresentationIl2008 Fostering Innovation Presentation
Il2008 Fostering Innovation Presentation
 
Ch1
Ch1Ch1
Ch1
 
Parfum De Toamna
Parfum De ToamnaParfum De Toamna
Parfum De Toamna
 
Stati della materia e Passaggi di stato
Stati della materia e Passaggi di statoStati della materia e Passaggi di stato
Stati della materia e Passaggi di stato
 

Último

Hi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVC
Hi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVCHi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVC
Hi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVC
schonejummy
 
Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...
Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...
Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...
daisycvs
 
Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...
Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...
Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...
schonejummy
 
IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...
IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...
IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...
schonejummy
 
Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...
Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...
Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...
ramacollinz
 
Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...
Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...
Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...
schonejummy
 
ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...
ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...
ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...
cytotecshop6
 
Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...
Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...
Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...
daisycvs
 
IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.
IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.
IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.
zuhaibhaideri99
 
Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...
Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...
Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...
fionamali24
 
Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.
Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.
Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.
fionamali24
 
ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...
ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...
ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...
ramacollinz
 

Último (14)

Hi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVC
Hi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVCHi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVC
Hi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVC
 
Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...
Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...
Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...
 
《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》
《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》
《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》
 
Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...
Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...
Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...
 
IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...
IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...
IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...
 
Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...
Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...
Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...
 
Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...
Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...
Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...
 
ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...
ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...
ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...
 
Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...
Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...
Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...
 
cs代写服务如何收费?坚持高性价比的服务宗旨 ,满足更多留学生的CS作业代写需求,为大家提供最合理的代写价格。
cs代写服务如何收费?坚持高性价比的服务宗旨 ,满足更多留学生的CS作业代写需求,为大家提供最合理的代写价格。cs代写服务如何收费?坚持高性价比的服务宗旨 ,满足更多留学生的CS作业代写需求,为大家提供最合理的代写价格。
cs代写服务如何收费?坚持高性价比的服务宗旨 ,满足更多留学生的CS作业代写需求,为大家提供最合理的代写价格。
 
IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.
IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.
IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.
 
Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...
Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...
Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...
 
Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.
Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.
Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.
 
ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...
ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...
ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...
 

Ch4 Relational Mapping

  • 2. 步驟一:將各個實體畫出,並加上屬性,並將主鍵標為 PK ( 組合屬性為 Name 、 Fname 、 Minit 、 Lname ,則 Name 不需要加上去,如上所示 ) Employee Ssn Bdate Name Fname Minit Lname Address Salary Sex Employee Eependents_of Dependents_of 1 N Name Sex Birth_date Relationship PK Supervision 1 Supervisor N Superises Sex Salary Address Bdate Ssn Lname Minit Fname
  • 3. Employee FK PK 步驟二:將弱實體前,加上強實體的主鍵,成為外來鍵 步驟三:下頁說明->為了配合圖形,先說明步驟四 步驟四:若有 1:N 時,將 1 那邊實體的主鍵, 加到 N 那邊成為外來鍵 ( 若是遞迴關係,則將主鍵從新命名, 原因:為了避免在同一個欄位出現兩個相同的 ssn) FK PK PK ( 因此原本是 ssn ,從新命名後變成 Super_ssn) Employee Dependent 請參考前一頁投影片上的 ER 圖 Sex Salary Address Bdate Ssn Lname Minit Fname Relationship Birth_date Sex Name Employee_ssn Super_ssn Sex Salary Address Bdate Ssn Lname Minit Fname
  • 4. Department Name Locations Number Manages 1 1 步驟三: 1 對 1 時,將任一個實體的主鍵 加到另一邊上,成為外來鍵 PS :若是如上圖所以,有一邊是完全參予 的話,則將 1 條線上實體的主鍵,加 到 2 條線時那邊成為外來鍵 PK FK Department 如上圖,將 employee 的主鍵 放到 department 當外來鍵 Number Name Employee_ssn
  • 5.
  • 6. Locations 步驟六: 如下圖 ,將多值屬性再創一個關連表, 且把自身當成外來鍵 ( 例: Locations_ 名稱 ) ,再加上原實體的主鍵形成外來鍵, 兩個外來鍵合成一個主鍵 R1 E1 E2 E3 e1 e2 e3 r1 步驟七: 如上圖 多元關係,將關係轉變成新的 關聯表,並將關係上連結的實體的主鍵 放上去變成外來鍵,外來鍵加起來就是主鍵 FK FK PK Locations_ 名稱 Department_name
  • 7.
  • 8.
  • 9.
  • 10. 大 家 加 油 如有錯誤,請提出指教 ~