You are on page 1of 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
parteek.bhatia@gmail.com
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