0% found this document useful (0 votes)
144 views4 pages

Conversion of E-R Diagram To Tables

This document discusses converting an entity-relationship (E-R) diagram to database tables. It states that each entity set and relationship set is represented by a unique table with columns for attributes. Primary keys allow uniform representation of entities and relationships as tables. Composite attributes are flattened into separate columns. Generalization can be represented by either creating a table for each subclass, which requires joins, or by creating a single table with all inherited attributes, which causes redundancy. The document provides examples of each approach.

Uploaded by

Kabir Dhankhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
144 views4 pages

Conversion of E-R Diagram To Tables

This document discusses converting an entity-relationship (E-R) diagram to database tables. It states that each entity set and relationship set is represented by a unique table with columns for attributes. Primary keys allow uniform representation of entities and relationships as tables. Composite attributes are flattened into separate columns. Generalization can be represented by either creating a table for each subclass, which requires joins, or by creating a single table with all inherited attributes, which causes redundancy. The document provides examples of each approach.

Uploaded by

Kabir Dhankhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

12/10/2012

• For each entity set and relationship set


there is a unique table, which is assigned
Conversion of E-R Diagram to the name of the corresponding entity set
Tables or relationship set. Each table has a
number of columns (generally
By
Parteek Bhatia
corresponding to attributes), which have
Assistant Professor unique names. Primary keys allow entity
Department of Comp Sc & Engg
Thapar University
sets and relationship sets to be expressed
Patiala uniformly as tables, which represent the
[email protected]
contents of the database.

Composite and Multi-Value


Representing Entity sets as
Attributes
Tables
• In order to convert an entity having
composite attributes, the composite
attributes are flattened out by creating a
separate attribute for each component
attribute.

1
12/10/2012

2
12/10/2012

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.

• Method 2:
– Form a schema for each entity set with all local and inherited
attributes

• Method 2 schema attributes


• In second method we create only two person name, street, city
customer name, street, city, credit_rating
tables as shown below: employee name, street, city, salary
• Saving_Account: Account_Number, – If specialization is total, the schema for the generalized entity set
Balance, Interest_rate (person) not required to store information
• Checking _Account: Account_Number, • Can be defined as a “view” relation containing union of
specialization relations
Balance, Overdraft_Amount • But explicit schema may still be needed for foreign key
• The problem of this is the redundancy of constraints
– Drawback: street and city may be stored redundantly for people
Balance field. who are both customers and employees

3
12/10/2012

References
Simplified Approach To DBMS
By
Parteek Bhatia
Kalyani Publishers

You might also like