Professional Documents
Culture Documents
You might see some confusion in Sub-class and UNION; consider example in above
figure Vehicle is super-class of CAR and Truck; this is very much the correct example of
subclass as well but here use it different we are saying RTO Registered vehicle is
UNION of Car and Vehicle, they do not inherit any attribute of Vehicle, attributes of car
and truck are altogether independent set, where is in sub-classing situation car and
truck would be inheriting the attribute of vehicle class. Below is Vehicle as modeled as
class of Car and Truck.
References –
comet.lehman.cuny.edu
cs.toronto.edu
This article is contributed by Kadam Patel. If you like GeeksforGeeks and would like to
contribute, you can also write an article using contribute.geeksforgeeks.org or mail your
article to contribute@geeksforgeeks.org. See your article appearing on the
GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more
information about the topic discussed above.
Specialization –
In specialization, an entity is divided into sub-entities based on their characteristics. It is
a top-down approach where higher level entity is specialized into two or more lower
level entities. For Example, EMPLOYEE entity in an Employee management system
can be specialized into DEVELOPER, TESTER etc. as shown in Figure 2. In this case,
common attributes like E_NAME, E_SAL etc. become part of higher entity
(EMPLOYEE) and specialized attributes like TES_TYPE become part of specialized
entity (TESTER).
Aggregation –
An ER diagram is not capable of representing relationship between an entity and a
relationship which may be required in some scenarios. In those cases, a relationship
with its corresponding entities is aggregated into a higher level entity. For Example,
Employee working for a project may require some machinery. So, REQUIRE
relationship is needed between relationship WORKS_FOR and entity MACHINERY.
Using aggregation, WORKS_FOR relationship with its entities EMPLOYEE and
PROJECT is aggregated into single entity and relationship REQUIRE is created
between aggregated entity and MACHINERY.
This article is contributed by Sonal Tuteja. If you like GeeksforGeeks and would like to
contribute, you can also write an article using contribute.geeksforgeeks.org or mail your
article to contribute@geeksforgeeks.org. See your article appearing on the
GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more
information about the topic discussed above.
EER Model
EER is a high-level data model that incorporates the extensions to the original
ER model.
Sub class and Super class relationship leads the concept of Inheritance.
The relationship between sub class and super class is denoted
with symbol.
1. Super Class
Super class is an entity type that has a relationship with one or more subtypes.
An entity cannot exist in database merely by being member of any super class.
For example: Shape super class is having sub groups as Square, Circle,
Triangle.
2. Sub Class
1. Generalization
Generalization is the process of generalizing the entities which contain the
properties of all the generalized entities.
It is a bottom approach, in which two lower level entities combine to form a
higher level entity.
Generalization is the reverse process of Specialization.
It defines a general entity type from a set of specialized entity type.
It minimizes the difference between the entities by identifying the common
features.
For example:
In the above example, Tiger, Lion, Elephant can all be generalized as Animals.
2. Specialization
C. Category or Union
Category represents a single super class or sub class relationship with more
than one super class.
It can be a total or partial participation.
For example Car booking, Car owner can be a person, a bank (holds a
possession on a Car) or a company. Category (sub class) → Owner is a subset
of the union of the three super classes → Company, Bank, and Person. A
Category member must exist in at least one of its super classes.
D. Aggregation
In the above example, the relation between College and Course is acting as an
Entity in Relation with Student.