What are generalization, specialization and aggregation in the ER model?
MediumConceptER Model
Answer
These are extended ER (EER) features used to model hierarchies of entities and relationships between relationships.
- Generalization is bottom-up: the common attributes of several entity sets are combined into a higher-level entity.
CarandBikesharereg_noandcolour, so they are generalized intoVehicle. - Specialization is top-down: an entity set is divided into sub-groups with their own attributes.
Employeeis specialized intoEngineer(withskill) andManager(withbudget). Both create an "is-a" hierarchy in which subclasses inherit the superclass attributes. - Aggregation treats a relationship, together with the entities it connects, as one higher-level entity, so that it can take part in another relationship.
Example: Employee works on Project, and a Machine is used by a particular employee-project pair. A plain ER diagram cannot connect an entity to a relationship, so the box around (Employee - works on - Project) is treated as one entity, and uses links Machine to that box. As a table: uses(emp_id, project_id, machine_id).