Wednesday, October 26, 2011

Aggregation


Question  :: What do you mean by aggregation ?Explain How Aggregation used to remove Redundant Relationship ?
Answer :
Aggregation (Definition): One limitation of the E-R model is that it cannot
express relationships among relationships. Aggregation is an abstraction through
which relationships are treated as higher-level entities. Aggregation is an
abstraction through which we can express relationships among two relationships.

Let’s consider manger wants to manage Employee, branch in which employee
working and jobs. Using the basic E-R modeling constructs, we obtain the E-R
diagram as shown in Figure 1. It appears that the relationship sets works-on and
manages can be combined into one single relationship set. We should not combine
them into a single relationship, since some employee, branch, job combinations
many not have a manager.


Figure : E-R diagram with redundant relationships

As shown in Figure 1, Every Employee, Job and Branch combined with
manager, also combined with works-on. Therefore we can say this diagram have
many redundant relationships. If the manager were a value rather than a manager
entity, we could instead make manager a multivalued attribute
of the relationship works-on and we can avoid redundant relationships. But doing it
is more difficult task because manager is entity.
The best way to model such a situation is to use aggregation. Aggregation
is an abstraction through which relationships are treated as higher-level entities.
Thus, for our example, we can take works-on(relating the entity sets employee,
branch, and job) as higher level entity set .Then we can create binary relationship
with manages that react as lower level entity sets.


As shown in Figure 2, Works-on relationships set acting as higher level entity
set with combination with Employee, Job and branch. This higher level entity set
creates binary relationship with manages, a lower level entity set i.e. relationship
between two relationship sets and redundant relationships can be reduced.



No comments:

Post a Comment