SlideShare a Scribd company logo
CS3200 – Database Design···Spring 2018···Derbinsky
ER-to-Relational
Mapping
1
CS3200 – Database Design···Spring 2018···Derbinsky
Resulting Relational Schema
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
4
CS3200 – Database Design···Spring 2018···Derbinsky
Example ERD
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
5
CS3200 – Database Design···Spring 2018···Derbinsky
Step 1 Result
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
6
CS3200 – Database Design···Spring 2018···Derbinsky
Step 2: Weak Entity Types
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
7
i. For each weak entity type, create a
corresponding relation that includes all the
simple attributes
ii. Add as a foreign key all of the primary key
attribute(s) in the entity corresponding to
the owner entity type
CS3200 – Database Design···Spring 2018···DerbinskyExample
ERD
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
8
CS3200 – Database Design···Spring 2018···Derbinsky
Step 2 Result
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
9
CS3200 – Database Design···Spring 2018···DerbinskyStep 3: Mapping Binary 1 -to-1
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
10
Foreign Key
i. Choose one relation as S, the other T
 Better if S has total participation (reduces
number of NULL values)
ii. Add to S all the simple attributes of the
relationship
iii. Add as a foreign key in S the primary key
attributes of T
CS3200 – Database Design···Spring 2018···DerbinskyExample ERD
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
11
CS3200 – Database Design···Spring 2018···Derbinsky
Step 3 Result
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
12
CS3200 – Database Design···Spring 2018···DerbinskyStep 4: Binary 1-
to-N
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
13
i. Choose the S relation as the type at the
N-side of the relationship, other is T
ii. Add as a foreign key to S all of the
primary key attribute(s) of T
Another approach: create a relationship
relation
CS3200 – Database Design···Spring 2018···DerbinskyExample
ERD
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
14
CS3200 – Database Design···Spring 2018···Derbinsky
Step 4 Result
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
15
CS3200 – Database Design···Spring 2018···DerbinskyStep 5: Multivalued
Attributes
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
16
i. Create a new relation S
ii. Add as foreign keys the primary keys of
the corresponding relation
iii. Add the attribute to S (if composite, the
simple attributes); the combination of all
attributes in S forms the primary key
CS3200 – Database Design···Spring 2018···DerbinskyExample
ERD
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
17
CS3200 – Database Design···Spring 2018···Derbinsky
Step 6 Result
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
18
CS3200 – Database Design···Spring 2018···Derbinsky
Step 7: Specialization/Generalization
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
19
A. Multiple relations – subclass and superclass
 Usually works (assumes unique id at parent)
B. Multiple relations – subclass only
 Should only be used for disjoint
C. Single relation with one type attribute
 Only for disjoint, can result in many NULLs
D. Single relation with multiple type attributes
 Better for overlapping, could be disjoint
CS3200 – Database Design···Spring 2018···DerbinskySpecialization/Generalization
(A)
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
20
CS3200 – Database Design···Spring 2018···DerbinskySpecialization/Generalization
(B)
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
21
CS3200 – Database Design···Spring 2018···DerbinskySpecialization/Generalization
(C)
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
22
CS3200 – Database Design···Spring 2018···DerbinskySpecialization/Generalization
(D)
ER-TO-RELATIONAL MAPPING
MARCH 1, 2018
23

More Related Content

More from RUpaliLohar

Relational model
Relational modelRelational model
Relational model
RUpaliLohar
 
Relational algebra.pptx
Relational algebra.pptxRelational algebra.pptx
Relational algebra.pptx
RUpaliLohar
 
Mobile ip
Mobile ipMobile ip
Mobile ip
RUpaliLohar
 
Mac
MacMac
gprs
gprsgprs
Dbms keys
Dbms keysDbms keys
Dbms keys
RUpaliLohar
 
Relational model
Relational modelRelational model
Relational model
RUpaliLohar
 
EER MODEL
EER MODELEER MODEL
EER MODEL
RUpaliLohar
 
Gsm security algorithms A3 , A5 , A8
Gsm security algorithms A3 , A5 , A8Gsm security algorithms A3 , A5 , A8
Gsm security algorithms A3 , A5 , A8
RUpaliLohar
 
Localization & calling
Localization  & callingLocalization  & calling
Localization & calling
RUpaliLohar
 
Gsm signaling protocol
Gsm signaling protocolGsm signaling protocol
Gsm signaling protocol
RUpaliLohar
 
Mapping cardinality (cardinality constraint) in ER MODEL
Mapping cardinality (cardinality constraint) in ER MODELMapping cardinality (cardinality constraint) in ER MODEL
Mapping cardinality (cardinality constraint) in ER MODEL
RUpaliLohar
 
GSM Radio interface
GSM Radio interfaceGSM Radio interface
GSM Radio interface
RUpaliLohar
 
Gsm services
Gsm servicesGsm services
Gsm services
RUpaliLohar
 
Electromagnetic wave
Electromagnetic waveElectromagnetic wave
Electromagnetic wave
RUpaliLohar
 
Gsm architecture
Gsm architectureGsm architecture
Gsm architecture
RUpaliLohar
 
Entity relationship model
Entity relationship modelEntity relationship model
Entity relationship model
RUpaliLohar
 
Spread spectrum
Spread spectrumSpread spectrum
Spread spectrum
RUpaliLohar
 
Data model
Data modelData model
Data model
RUpaliLohar
 
DBMS architecture &; system structure
DBMS architecture &; system  structureDBMS architecture &; system  structure
DBMS architecture &; system structure
RUpaliLohar
 

More from RUpaliLohar (20)

Relational model
Relational modelRelational model
Relational model
 
Relational algebra.pptx
Relational algebra.pptxRelational algebra.pptx
Relational algebra.pptx
 
Mobile ip
Mobile ipMobile ip
Mobile ip
 
Mac
MacMac
Mac
 
gprs
gprsgprs
gprs
 
Dbms keys
Dbms keysDbms keys
Dbms keys
 
Relational model
Relational modelRelational model
Relational model
 
EER MODEL
EER MODELEER MODEL
EER MODEL
 
Gsm security algorithms A3 , A5 , A8
Gsm security algorithms A3 , A5 , A8Gsm security algorithms A3 , A5 , A8
Gsm security algorithms A3 , A5 , A8
 
Localization & calling
Localization  & callingLocalization  & calling
Localization & calling
 
Gsm signaling protocol
Gsm signaling protocolGsm signaling protocol
Gsm signaling protocol
 
Mapping cardinality (cardinality constraint) in ER MODEL
Mapping cardinality (cardinality constraint) in ER MODELMapping cardinality (cardinality constraint) in ER MODEL
Mapping cardinality (cardinality constraint) in ER MODEL
 
GSM Radio interface
GSM Radio interfaceGSM Radio interface
GSM Radio interface
 
Gsm services
Gsm servicesGsm services
Gsm services
 
Electromagnetic wave
Electromagnetic waveElectromagnetic wave
Electromagnetic wave
 
Gsm architecture
Gsm architectureGsm architecture
Gsm architecture
 
Entity relationship model
Entity relationship modelEntity relationship model
Entity relationship model
 
Spread spectrum
Spread spectrumSpread spectrum
Spread spectrum
 
Data model
Data modelData model
Data model
 
DBMS architecture &; system structure
DBMS architecture &; system  structureDBMS architecture &; system  structure
DBMS architecture &; system structure
 

Recently uploaded

DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 

Recently uploaded (20)

DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 

Lecture 08 mapping-converted

  • 1. CS3200 – Database Design···Spring 2018···Derbinsky ER-to-Relational Mapping 1
  • 2.
  • 3.
  • 4. CS3200 – Database Design···Spring 2018···Derbinsky Resulting Relational Schema ER-TO-RELATIONAL MAPPING MARCH 1, 2018 4
  • 5. CS3200 – Database Design···Spring 2018···Derbinsky Example ERD ER-TO-RELATIONAL MAPPING MARCH 1, 2018 5
  • 6. CS3200 – Database Design···Spring 2018···Derbinsky Step 1 Result ER-TO-RELATIONAL MAPPING MARCH 1, 2018 6
  • 7. CS3200 – Database Design···Spring 2018···Derbinsky Step 2: Weak Entity Types ER-TO-RELATIONAL MAPPING MARCH 1, 2018 7 i. For each weak entity type, create a corresponding relation that includes all the simple attributes ii. Add as a foreign key all of the primary key attribute(s) in the entity corresponding to the owner entity type
  • 8. CS3200 – Database Design···Spring 2018···DerbinskyExample ERD ER-TO-RELATIONAL MAPPING MARCH 1, 2018 8
  • 9. CS3200 – Database Design···Spring 2018···Derbinsky Step 2 Result ER-TO-RELATIONAL MAPPING MARCH 1, 2018 9
  • 10. CS3200 – Database Design···Spring 2018···DerbinskyStep 3: Mapping Binary 1 -to-1 ER-TO-RELATIONAL MAPPING MARCH 1, 2018 10 Foreign Key i. Choose one relation as S, the other T  Better if S has total participation (reduces number of NULL values) ii. Add to S all the simple attributes of the relationship iii. Add as a foreign key in S the primary key attributes of T
  • 11. CS3200 – Database Design···Spring 2018···DerbinskyExample ERD ER-TO-RELATIONAL MAPPING MARCH 1, 2018 11
  • 12. CS3200 – Database Design···Spring 2018···Derbinsky Step 3 Result ER-TO-RELATIONAL MAPPING MARCH 1, 2018 12
  • 13. CS3200 – Database Design···Spring 2018···DerbinskyStep 4: Binary 1- to-N ER-TO-RELATIONAL MAPPING MARCH 1, 2018 13 i. Choose the S relation as the type at the N-side of the relationship, other is T ii. Add as a foreign key to S all of the primary key attribute(s) of T Another approach: create a relationship relation
  • 14. CS3200 – Database Design···Spring 2018···DerbinskyExample ERD ER-TO-RELATIONAL MAPPING MARCH 1, 2018 14
  • 15. CS3200 – Database Design···Spring 2018···Derbinsky Step 4 Result ER-TO-RELATIONAL MAPPING MARCH 1, 2018 15
  • 16. CS3200 – Database Design···Spring 2018···DerbinskyStep 5: Multivalued Attributes ER-TO-RELATIONAL MAPPING MARCH 1, 2018 16 i. Create a new relation S ii. Add as foreign keys the primary keys of the corresponding relation iii. Add the attribute to S (if composite, the simple attributes); the combination of all attributes in S forms the primary key
  • 17. CS3200 – Database Design···Spring 2018···DerbinskyExample ERD ER-TO-RELATIONAL MAPPING MARCH 1, 2018 17
  • 18. CS3200 – Database Design···Spring 2018···Derbinsky Step 6 Result ER-TO-RELATIONAL MAPPING MARCH 1, 2018 18
  • 19. CS3200 – Database Design···Spring 2018···Derbinsky Step 7: Specialization/Generalization ER-TO-RELATIONAL MAPPING MARCH 1, 2018 19 A. Multiple relations – subclass and superclass  Usually works (assumes unique id at parent) B. Multiple relations – subclass only  Should only be used for disjoint C. Single relation with one type attribute  Only for disjoint, can result in many NULLs D. Single relation with multiple type attributes  Better for overlapping, could be disjoint
  • 20. CS3200 – Database Design···Spring 2018···DerbinskySpecialization/Generalization (A) ER-TO-RELATIONAL MAPPING MARCH 1, 2018 20
  • 21. CS3200 – Database Design···Spring 2018···DerbinskySpecialization/Generalization (B) ER-TO-RELATIONAL MAPPING MARCH 1, 2018 21
  • 22. CS3200 – Database Design···Spring 2018···DerbinskySpecialization/Generalization (C) ER-TO-RELATIONAL MAPPING MARCH 1, 2018 22
  • 23. CS3200 – Database Design···Spring 2018···DerbinskySpecialization/Generalization (D) ER-TO-RELATIONAL MAPPING MARCH 1, 2018 23