Extended ER Model
As we know ER Model is used for database modeling (designing). In 1980’s as the complexity of data increase due to which the traditional database model fails to fulfill the requirements of database modeling.
That’s why, some features were added to traditional ER Model which becomes extended ER Model. Those added features were
General Symbol of Generalization or Specialization is a
Let explain all terms (generalization, specialization and aggregation) one by one,
- Generalization is a bottom-up approach where two or more entities from lower-level can combine to form a higher-level entity, if they have some attributes in common.
- In simple words, generalization extract the common attributes form different set of entities and create a generalized entity from it.
For example, Consider Lower-level entities are Car, Bus and Bike. These three entities from lower-level combine together and creates a higher-level entity as Vehicle. following diagram represents the
Keep in mind: Lower-level entities are consider as sub-classes. And higher level entities are consider as super-class.
- Specialization is opposite to Generalization.
- In specialization is a top-down approach where one higher-level entity can broken down into two lower-level entities.
For example: Consider higher-level entity is a Vehicle. This higher-level entity break down into lower-level entities (i.e. Car, Bus and Bike).
Inheritance is an important feature of generalization and specialization.Attribute inheritance allows to inherit the attributes from lower to higher level in generalization or higher to lower level in specialization.
Inheritance in Generalization. ( inheriting the attributes from lower to higher level)
Vehicle can inherit all attributes of its lower-level .So in following example vahicle entiy will contains 6 attributes. Three attributes( i.e. Company, model , chaisis_No) of itself and three attributes are inherited (i.e. Stereeo_present, Street_No, Load_capacity ) from lower entities. So no need to mention all 6 attributes in Vehicle entity.
Inheritance in Specilization. ( inheriting the attributes from Higher to lower level)After inheritance in specialization all lower-level entities will hold the attributes of its higher-level attribute.So in above example Car, Bus and Bike will hold four attributes each. One attribute itself and three inherited from its higher-level(vehicle).Note: inheritance must be there in the relationship but inheritance may be either specialization or generalization.
When a relationship between two entities is considered as single entity and again this single entity has a relationship with another entity is known as aggregation.
Aggregation is use when need to express a relationship among relationships.
For example: Employee, Job and branch are treated as a single entity which having a relationship with Manager. As explain in following diagram.