Ref Model
Ref Model
● Figure out all the regular/strong entities from the diagram and
then create a corresponding relation(table) that includes all the
simple attributes.
● Choose one of the attributes as a primary key. If composite, the
simple attributes together form the primary key.
● For the given ER-Diagram we have Employee, Department
and Project as strong/regular entities, as they are enclosed in a
single rectangle.
● So, we create respective relations that are depicted in the figure
below.
After step 1:
Step 2:
● Figure out the weak entity types from the diagram and create a
corresponding relation(table) that includes all its simple
attributes.
● Add as foreign key all of the primary key attributes in the entity
corresponding to the owner entity.
● The primary key is a combination of all the primary key
attributes from the owner and the primary key of the weak
entity.
● For the given ER-Diagram we have Dependent as a weak entity,
as it is enclosed in a double rectangle that is indicative of an
entity being weak.
● The Dependent relation(table) is created that is shown in the
figure below.
Step 3:
● Now we need to figure out the entities from the ER diagram for
which there exists a 1-to-1 relationship.
● The entities for which there exists a 1-to-1 relationship, choose
one relation(table) as S, the other as T.
Better if S has total participation (reduces the number of NULL
values).
● Then we need to add to S all the simple attributes of the
relationship if there exists any.
● After that, we add as a foreign key in S the primary key
attributes of T.
● For the given ER-Diagram there exists a 1-to-1 relationship
between Employee and Department entity.
● Here Department has total participation therefore consider it
as relation S and Employee as relation T.
● The 1-to-1 mapping between Employee and Department is
depicted in the figure below.
Step 4: