0% found this document useful (0 votes)
59 views3 pages

ER-to-Relational Mapping - English

The document outlines a 7-step algorithm for mapping an entity-relationship diagram to tables in a relational database. Step 1 maps regular entity types to tables, with attributes as columns and keys. Step 2 maps weak entities similarly. Step 3 maps 1:N relationships by moving keys. Step 4 maps M:N relationships to tables with composite keys. Steps 5-6 map multivalued attributes and N-ary relationships similarly. Step 7 details mapping 1:1 relationships based on participation constraints. Relationship attributes are moved with primary keys during mapping.

Uploaded by

ddd
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)
59 views3 pages

ER-to-Relational Mapping - English

The document outlines a 7-step algorithm for mapping an entity-relationship diagram to tables in a relational database. Step 1 maps regular entity types to tables, with attributes as columns and keys. Step 2 maps weak entities similarly. Step 3 maps 1:N relationships by moving keys. Step 4 maps M:N relationships to tables with composite keys. Steps 5-6 map multivalued attributes and N-ary relationships similarly. Step 7 details mapping 1:1 relationships based on participation constraints. Relationship attributes are moved with primary keys during mapping.

Uploaded by

ddd
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/ 3

1

ER-to-Relational Mapping Algorithm


Step 1: Mapping of Regular Entity Types
Each ENTITY (strong) becomes a table holds its name, its attributes become columns in this table and the
key attribute becomes a PK (except For multivalued attributes)

Step 2: Mapping of Weak Entity Types


Each Weak entity becomes a table holds its name, its attributes become columns in this table and the
candidate attribute with Pk of the entity it belongs to both become a PK

Step 3: Mapping of Binary 1: N Relationship Types


Every 1: N relationship mapped by moving the PK from the one side to the N side

Step 4: Mapping of Binary M: N Relationship Types


Each M: N relationship becomes a table holds its name, its attributes become columns in this table and
PKs for the two tables associated with the relationship both become a PK.

Step 5: Mapping of Multivalued attributes.


Each Multivalued attribute becomes a table named as a mixture of the attribute and entity it belongs to.
The PK for the result table is the attribute itself with key of the ENTITY it belongs to.

2
Step 6: Mapping of N-ary Relationship Types.
Each N-ary relationship becomes a table holds its name, its attributes become columns in this table and
its PK is the PKs for all tables associated with the relationship.

Step 7: Mapping of Binary 1:1 Relationship Types


In the case of 1: 1 relationship we look at the participation on both sides:

If -------: ===== we move the PK from partial side ----- to total side =====

If ====: ===== we merge the two tables and the relationship into one table

If -------: ------- the relation becomes a table holds its name, its attributes become columns in this table
and its PK is the PKs for the two tables associated with the relationship.

Important Note: When we move the PK from one table to another by MAPPING, it becomes a foreign
key (FK) in the destination table. In other words “strange key” so it is preferable to point to the table of
origin for that key.

During mapping, relationship attributes must be moved to the same side where you moved the primary
key.

You might also like