Topic 05
Topic 05
Topic 5
Basic Mapping: The Transformation Process
Reminder:
Intellectual Property
◼ Copyright must be seriously protected. The University
takes a strong stand against any illegal photocopying and
distributing of all materials provided to students. Students
are forewarned of the consequences and the penalty that
may be meted out if they are “caught in the act”.
◼ All the materials provided to student SHOULD NOT be
posted/distributed at any online platform or any other
ways possible without the permission.
Objectives
10
How to represent relationships
11
1:* binary relationships
◼ Entity on ‘one side’ of relationship is designated
as the parent entity and entity on ‘many side’ is
designated as child entity.
12
1:* relationship – (a) ER diagram; (b) as
tables
13
1:* recursive relationships
◼ The representation of a 1:* recursive
relationship is similar to 1:* binary
relationship.
◼ However, in this case, both the parent and
child entity is the same entity.
14
1:* recursive relationships – (a) ER diagram;
(b) as tables
15
1:1 binary relationships
◼ PK on the mandatory side becomes a FK on
the optional side.
◼ Either represent the relationship by
combining the entities involved into one
table or by creating two tables and posting a
copy of the primary key from one table to
the other.
16
*:* binary relationships
◼ Create a table to represent the relationship and
include any attributes that are part of the
relationship.
◼ Post a copy of the primary key attribute(s) of the
entities that participate in the relationship into the
new table, to act as foreign keys.
◼ One or both of the foreign keys will also form the
primary key of the new table, possibly in
combination with some of the attributes of the
relationship.
17
*:* binary relationships – (a) ER diagram; (b)
as tables
Multi-valued attributes
◼ A new table is created to hold the multi-valued
attribute and the parent entity posts a copy of its
primary key, to act as a foreign key.
19
Multi-valued attributes – ER diagram and
representation as tables
20
Map all tables