Professional Documents
Culture Documents
(CLASS-L11)
Presented By:
Monalisa Panigrahi
Asst.Professor (LPU)
B2702-CSE 301
10/5/2009 1
Reduction of an E-R Schema
to Tables
Primary keys allow entity sets and relationship
sets to be expressed uniformly as tables which
represent the contents of the database.
A database which conforms to an E-R diagram
can be represented by a collection of tables.
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.
Converting an E-R diagram to a table format is
the basis for deriving a relational database
design from an E-R diagram.
10/5/2009 2
Conversion of Strong Entities
10/5/2009 3
Example
10/5/2009 4
Conversion of Strong
Entity(Customer)
10/5/2009 5
Conversion of Weak Entities
10/5/2009 6
Example
10/5/2009 7
Conversion of Weak
Entity(payment)
10/5/2009 8
Conversion of Relationship
sets
10/5/2009 9
Conversion of one-one
Relationship
For each one-one relationship,(betn
A and B),modify one of the table
(A or B),to include the P.Key of
other relation as F.Key
If relationship has attributes,it must
be transferred to the modified
relation
If any relation has a total
participation, only that table must
10/5/2009 10
be modifed
Conversion of one-many
Relationship
For each one-Many relationship,
modify N-side relation to hold the
primary key of other as a foreign
key
10/5/2009 11
Conversion of many-many
Relationship
A many-to-many relationship set is
represented as a table with columns
for the primary keys of the two
participating entity sets, and any
descriptive attributes of the
relationship set.
10/5/2009 12
Example
10/5/2009 13
EX: Table for relationship set
borrower
10/5/2009 14
Conversion of Multivalued
Attributes
For each Multivalued attribute,
create a separate table and include
primary key of the strong entity as
a foreign key
10/5/2009 15
Representing Specialization
as Tables –
10/5/2009 16
Method 1:
Form a table for the higher level entity (
Person)
Form a table for each lower level entity set,
include primary key of higher level entity set
and local attributes
Tables Attributes
Person name, street, city
Customer name, credit-rating
10/5/2009 19
Example:
To represent aggregation manages between
relationship works-on and entity set manager,
create a table
manages(employee-id, branch-name, title,
manager-name)
10/5/2009 20
Advantages Of E-R model
1. Conceptual Simplicity
2. Maps well to the relational model
3. Simple and easy to understand
4. It is acting as a effective
communication tool between user
and developer
10/5/2009 21
Disadvantages Of E-R model
10/5/2009 22
10/5/2009 23