Page 103 - DCAP402_DCAO204_DATABASE MANAGEMENT SYSTEM_MANAGING DATABASE
P. 103
Database Management Systems/Managing Database
Notes 6.9.3 Binary versus n-ary Relationship Sets
It is always possible to replace a no binary (n-ary, for n > 2) relationship set by a number of
distinct binary relationship sets. For simplicity, consider the abstract ternary (n = 3) relationship
set R, relating entity sets A, B and C. We replace the relationship set R by an entity set E, and
create three relationship sets:
1. R , relating E and A
A
2. R relating E and B
B
3. R , relating E and C
C
If the relationship set R had any attributes, these are assigned to entity set E; otherwise, a special
identifying attribute is created for E (since every entity set must have at least one attribute to
distinguish members of the set). For each relationship (a., b, c.) in the relationship set R, we
create a new entity e. in the entity set E. Then, in each of the three new relationship sets, we insert
a relationship as follows
1. (ei, ai) in R
A
2. (ei, bi) in R
B
3. (ei, ci) in R
C
We can generalize this process in a straightforward manner n–ary relationship sets. Thus,
conceptually, we can restrict the E-R model to include only binary relationship sets.
6.9.4 Aggregation versus Ternary Relationships
The choice between using aggregation OT a ternary relationship is mainly determined by the
existence of relationship that relates a relationship set to an entity set (or second relationship
set). The choice may also be guided by certain integrity constraints to we want to express.
Consider the constraint that each sponsorship (of a project by a department) be monitored by at
most one employee. We cannot express this constraint in terms of the Sponsors2 relationship
set. Also we can express the constraint by drawing an arrow from the aggregated relationship.
Sponsors to the relationship Monitors. Thus, the presence of such a constraint serves as another
reason for using aggregation rather than a ternary relationship set.
Figure 6.7: Using a Ternary Relationship Instead of Aggregation
ename
eno salary
Employess
Strarted - on dname
pid pbudget dno budget
Projects Sponsors Departments
96 LOVELY PROFESSIONAL UNIVERSITY