SlideShare una empresa de Scribd logo
1 de 23
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

Más contenido relacionado

Más de RUpaliLohar

Relational model
Relational modelRelational model
Relational modelRUpaliLohar
 
Relational algebra.pptx
Relational algebra.pptxRelational algebra.pptx
Relational algebra.pptxRUpaliLohar
 
Relational model
Relational modelRelational model
Relational modelRUpaliLohar
 
Gsm security algorithms A3 , A5 , A8
Gsm security algorithms A3 , A5 , A8Gsm security algorithms A3 , A5 , A8
Gsm security algorithms A3 , A5 , A8RUpaliLohar
 
Localization & calling
Localization  & callingLocalization  & calling
Localization & callingRUpaliLohar
 
Gsm signaling protocol
Gsm signaling protocolGsm signaling protocol
Gsm signaling protocolRUpaliLohar
 
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 MODELRUpaliLohar
 
GSM Radio interface
GSM Radio interfaceGSM Radio interface
GSM Radio interfaceRUpaliLohar
 
Electromagnetic wave
Electromagnetic waveElectromagnetic wave
Electromagnetic waveRUpaliLohar
 
Gsm architecture
Gsm architectureGsm architecture
Gsm architectureRUpaliLohar
 
Entity relationship model
Entity relationship modelEntity relationship model
Entity relationship modelRUpaliLohar
 
DBMS architecture &; system structure
DBMS architecture &; system  structureDBMS architecture &; system  structure
DBMS architecture &; system structureRUpaliLohar
 

Más de 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
 

Último

INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxPurva Nikam
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 

Último (20)

INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 

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