Mapping ERD Into Relations
Mapping ERD Into Relations
Into Relations
Database Management System I
Objectives of this Chapter
• Explain the various restrictions on data that can be specified on a
relational database in the form of constraints.
• Establish and identify the relationships between tables.
• Transform an ER/EER Diagram into logical equivalent set of relations.
Step 1: Map Regular Entity
• Each simple column of the ER diagram becomes the column of the relations and
the identifier becomes the primary key of the relations.
• When a regular entity type has a composite column, only the simple component
columns are included in the relations.
Example 1
Example 2
Step 3: Map Binary Relationship
The procedure for representing relationship depends on both the degree of
relationships and the cardinalities of the relationships.
Map Binary One-to-Many Relationships
1. Create relation for each of the two entity types participating in the relationship, use the procedure
described in Step 1.
2. Incorporate the primary key column(s) of the entity on the one side of the relationships as a foreign key in
the relationship that is on the many-side of the relationship.
Step 3: Map Binary Relationship
Map Binary Many-to-Many Relationships
1. Create relation for each of the two entity types participating in the relationship.
2. Create a third relationship; include as foreign key columns in the third relation the primary keys of the
two participating relations.
Step 3: Map Binary Relationship
Map Binary One-to-One Relationships
1. Create relation for each of the two entity types participating in the relationship.
2. The primary key of one of the relations is included as a foreign key in the other relation.
The default primary key for the associative relation If a surrogate identifier is assigned to the associative entity
consists of the two primary key columns from the type, still an associative relation is created. However, the
other two relations. These columns are the foreign primary key for this relation is the surrogate identifier and the
keys that reference from the other two relations. primary keys of the two participating entity types are then
included as its foreign keys.
Step 5: Map Unary Relationships
Unary One-to-Many Relationship Unary Many-to-Many Relationships