Introduction to mapping from ER model to Relational model
To understand Mapping (conversion) from Entity Relationship Model to Relational Model, you should have a knowledge (an idea) about:
· ER model concepts
· Relation model concepts
in Database design, mapping or Conversion of an E-R
diagram into a relational model is very much required because E-R diagrams represent the
conceptual level of the database design while the relational model represents
the logical level of the Database design. The relational models can be easily implemented using RDBMS softwares like Oracle, MySQL, etc.
The following steps shows, how mapping ER diagram to relational model:
Step 1: Mapping the regular/strong entities
Step 2: Mapping the weak entities
Step 3: Mapping 1:1 Relationships
Step 4: Mapping 1:N Relationships
Step 5: Mapping N:N Relationships
Step 6: Mapping Multi-valued attribute and Composite attributes
Exammple: Consider the below ER diagram
In the above ER diagram, Employee as
an entity set and EmpNo, EmpName, and Salary as
its attributes. Here we map entity set into a relation Employee and
attributes of an entity set will become the columns inside the table. The key
attribute will become the primary key of the table.
Fig. 2 Mapping ER diagram into Relation |
Translation of a relationship into a
relation:
We map the entity set into the relation in a relational model,
we can also map a relationship set into a relation. The attribute of such a
relation includes key attributes of the participating relations. The attributes
are will become a foreign key.
For example: In the above diagram, there are two entity sets Employee and Department. These entity sets are participating in a relationship works in. The relationship set is converted into relation with attributes EmpNo from Employee relation, D_id from Department relation and Since, the attribute of the relationship set itself. Continue... |
Comments
Post a Comment