4 er to tables
DESCRIPTION
DBMS SLIDESTRANSCRIPT
![Page 1: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/1.jpg)
Conversion of E-R Diagram to Tables
![Page 2: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/2.jpg)
• For each entity set and relationship set there is a unique table, which is assigned the name of the corresponding entity set or relationship set. Each table has a number of columns (generally corresponding to attributes), which have unique names. Primary keys allow entity sets and relationship sets to be expressed uniformly as tables, which represent the contents of the database.
![Page 3: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/3.jpg)
Representing Entity sets as Tables
![Page 4: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/4.jpg)
Composite and Multi-Value Attributes
• In order to convert an entity having composite attributes, the composite attributes are flattened out by creating a separate attribute for each component attribute.
![Page 5: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/5.jpg)
![Page 6: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/6.jpg)
![Page 7: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/7.jpg)
![Page 8: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/8.jpg)
![Page 9: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/9.jpg)
![Page 10: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/10.jpg)
![Page 11: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/11.jpg)
![Page 12: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/12.jpg)
![Page 13: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/13.jpg)
Representing Generalization as Tables
• There are two approaches to convert an E-R diagram representing generalization.
• Method 1• E-R diagram containing generalization as shown in figure
4.20 can be converted in following tables:• Account: Account_Number, Balance• Saving_Account: Account_Number, Interest_rate• Checking _Account: Account_Number,
Overdraft_Amount• The problem of this approach is that in order to obtain
Balance we have to join two tables.
![Page 14: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/14.jpg)
![Page 15: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/15.jpg)
• Method 2• In second method we create only two
tables as shown below:• Saving_Account: Account_Number,
Balance, Interest_rate• Checking _Account: Account_Number,
Balance, Overdraft_Amount• The problem of this is the redundancy of
Balance field.
![Page 16: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/16.jpg)
![Page 17: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/17.jpg)
![Page 18: 4 ER to Tables](https://reader033.vdocuments.mx/reader033/viewer/2022061115/5464a351b4af9f405d8b4f59/html5/thumbnails/18.jpg)