You are on page 1of 12

Enhanced ER Model

Prerequisite – Introduction of ER Model


Todays time the complexity of the data is increasing so it becomes more and more
difficult to use the traditional ER model for database modeling. To reduce this
complexity of modeling we have to make improvements or enhancements were made to
the existing ER model to make it able to handle the complex application in a better way.
Enhanced entity-relationship diagrams are advanced database diagrams very similar to
regular ER diagrams which represents requirements and complexities of complex
databases.
It is a diagrammatic technique for displaying the Sub Class and Super Class;
Specialization and Generalization; Union or Category; Aggregation etc.
Generalization and Specialization –
These are very common relationship found in real entities. However this kind of
relationships was added later as enhanced extension to classical ER
model. Specialized class are often called as subclass while generalized class are
called superclass, probably inspired by object oriented programming. A sub-class is
best understood by “IS-A analysis”. Following statements hopefully makes some
sense to your mind “Technician IS-A Employee”, “Laptop IS-A Computer”.
An entity is specialized type/class of other entity. For example, Technician is special
Employee in a university system Faculty is special class of Employee. We call this
phenomenon as generalization/specialization. In the example here Employee is
generalized entity class while Technician and Faculty are specialized class of
Employee.
Example – This example instance of “sub-class” relationships. Here we have four sets
employee: Secretary, Technician, and Engineer. Employee is super-class of rest three
set of individual sub-class is subset of Employee set.
 An entity belonging to a sub-class is related with some super-class entity. For
instance emp no 1001 is a secretary, and his typing speed is 68. Emp no 1009 is
engineer (sub-class) and her trade is “Electrical”, so forth.
 Sub-class entity “inherits” all attributes of super-class; for example employee 1001
will have attributes eno, name, salary, and typing speed.
Enhanced ER model of above example –

Constraints – There are two types of constraints on “Sub-class” relationship.


1. Total or Partial – A sub-classing relationship is total if every super-class entity is
to be associated with some sub-class entity, otherwise partial. Sub-class “job type
based employee category” is partial sub-classing – not necessary every employee
is one of (secretary, engineer, and technician), i.e. union of these three types is
proper subset of all employees. Whereas other sub-classing “Salaried Employee
AND Hourly Employee” is total; union of entities from sub-classes is equal to total
employee set, i.e. every employee necessarily has to be one of them.
2. Overlapped or Disjoint – If an entity from super-set can be related (can occur) in
multiple sub-class sets, then it is overlapped sub-classing, otherwise disjoint. Both
the examples: job-type based and salaries/hourly employee sub-classing are
disjoint.
Note – These constraints are independent of each other: can be “overlapped and total
or partial” or “disjoint and total or partial”. Also sub-classing has transitive property.
Multiple Inheritance (sub-class of multiple super classes) –
An entity can be sub-class of multiple entity types; such entities are sub-class of
multiple entities and have multiple super-classes; Teaching Assistant can subclass of
Employee and Student both. A faculty in a university system can be sub-class of
Employee and Alumnus both. In multiple inheritance, attributes of sub-class is union of
attributes of all super-classes.
Union –
 Set of Libray Members is UNION of Faculty, Student, and Staff. A union
relationship indicates either of type; for example: a library member is either Faculty
or Staff or Student.
 Below are two examples shows how UNION can be depicted in ERD – Vehicle
Owner is UNION of PERSON and Company, and RTO Registered Vehicle is
UNION of Car and Truck.

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.

Generalization, Specialization and Aggregation in ER


Model
Prerequisite – Introduction of ER Model
Generalization, Specialization and Aggregation in ER model are used for data
abstraction in which abstraction mechanism is used to hide details of a set of objects.
Generalization –
Generalization is the process of extracting common properties from a set of entities and
create a generalized entity from it. It is a bottom-up approach in which two or more
entities can be generalized to a higher level entity if they have some attributes in
common. For Example, STUDENT and FACULTY can be generalized to a higher level
entity called PERSON as shown in Figure 1. In this case, common attributes like
P_NAME, P_ADD become part of higher entity (PERSON) and specialized attributes
like S_FEE become part of specialized entity (STUDENT).

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.

It is a diagrammatic technique for displaying the following concepts

 Sub Class and Super Class


 Specialization and Generalization
 Union or Category
 Aggregation
These concepts are used when the comes in EER schema and the resulting
schema diagrams called as EER Diagrams.

Features of EER Model

 EER creates a design more accurate to database schemas.


 It reflects the data properties and constraints more precisely.
 It includes all modeling concepts of the ER model.
 Diagrammatic technique helps for displaying the EER schema.
 It includes the concept of specialization and generalization.
 It is used to represent a collection of objects that is union of objects of different
of different entity types.
A. Sub Class and Super Class

 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

 Sub class is a group of entities with unique attributes.


 Sub class inherits properties and attributes from its super class.
For example: Square, Circle, Triangle are the sub class of Shape super class.

B. Specialization and Generalization

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

 Specialization is a process that defines a group entities which is divided into


sub groups based on their characteristic.
 It is a top down approach, in which one higher entity can be broken down into
two lower level entity.
 It maximizes the difference between the members of an entity by identifying
the unique characteristic or attributes of each member.
 It defines one or more sub class for the super class and also forms the
superclass/subclass relationship.
For example
In the above example, Employee can be specialized as Developer or Tester,
based on what role they play in an Organization.

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

 Aggregation is a process that represent a relationship between a whole object


and its component parts.
 It abstracts a relationship between objects and viewing the relationship as an
object.
 It is a process when two entity is treated as a single entity.

In the above example, the relation between College and Course is acting as an
Entity in Relation with Student.

You might also like