You are on page 1of 3

Chapter – 4

The Enhanced E-R Model and Business Rules:

Introduction:- Business environment change dramatically. Business relationships are more comlex
and as a result, business data are much more complex as well. To better cope with these changes,
enhanced E-R model is used to represent the complex data encountered in today’s business
environment.

The term enhanced entity – relation(EER) model is used to identify the model that has resulted
from extending the original E-R model with new modeling constructs. The new modeling
construct in corporate in the EER model is super type/subtype relationships. This allows us to
model a general entity type called(Super type) and then subdivide it into several specialized entity
types called (Sub types). Ex:- the entity type VEHICLE can be modeled as a super type with the
sub types CAR, TAXI and so on. Each subtype inherits attributes from its supertype and in
additionmay have special attributes of its own.

ER, diagrams can become large and complex, requiring multiple pages for display, Entity is a
way to turn a part of an entity-relationship data model into a more macro-level view of the same
data. Entity clustering is a hierarchical decomposition techniques, which can make E-R diagrams
more easier to read. Enchanced ER is used to capture important business rules such as constraints
in supertype / subtype relationships.

* Representing supertypes and subtypes :-


An entity type is a collection of entities that share common properties or characteristics while
entity instances that compose an entity type are similar, but they may not be identical.
Subtype:- A subgrouping of the entities in an entity type that is meaningful to the organization and
that shares common attributes or relationships distinct from other subgroupings.
Supertype:- A generic entity type that has a relationship with one or more subtypes.
Ex:- Student is an entitytype in a University. Two subtypes of STUDENT are
GRADUATE_STUDENT and UNDERGRADUATE_STUDENT. STUDENT is a supertype and
the other two entity types are subtypes.

Attributes shared
by all entities

Super type General entity type

And so forth

Super type Super type Specialized version


of Supertype

Attributes unique Attributes unique


to subtype 1 to subtype 2

The supertype is connected with a line to a circle, which in turn is connected by a line to each
subtype that has been defined. The u-shaped symbol on each line connecting a subtypes to the
cirlcle indicates that the subtype is a subset of the supertype.

Attributes that are shared by all entities are associated with the Supertype. Attributes that are
unique to a particular subtypes are associated with that subtype.

Example:-
Emp_Nam Address
Emp_no e
Date_hire
d
EMPLOYEE

HOURLY EMPLOYEE SALARIED EMPLOYEE CONSULTANT

Hourly_Rat Annual Stock- Phone Billing rate


e salary option

Attribute Inheritance :- A property by which subtype entities inherit the values of all attributes of
the supertype.
An entity instance of a subtype, represents the same entity instance of the supertype. An entity
in a subtype must possess not only the values for its own attributes, but also values for its attributes
as a member of the supertype.
This important property makes it unnecessary to include supertype attributes
redundantly with the subtypes.
Ex:- The subtypes HOURLY EMPLOYEE etc., have inherited the attribute ‘Emp-Name’ from the
Supertype EMPLOYEE.

When to use Super/Sub type Relationships:- One should consider using subtypes when either(or both)
of the conditions are present :

1) There are attributes that apply to some (but not all) of the instance of an entity type.
2) The instances of a subtype participate in a relationship unique to that subtype.

Ex:- Illustrates both of these situations.


The hospital entity type PATIENT has 2 subtypes:

Patient-name Physician
-ID
Patient- Admit-
id date

PATIENT || PHYSICIAN
Is-called-
for

BED
Out Patient Resident patient |0 Is- ||
assigned

Check-Date Discharge Bed-id


Date

Supertype / Subtype relationship in a hospital.

Generalization and specialization :-


To develop real world data models and to recognize subtypes or supertypes relationships, there
are two process a) Generaization and b) Specialization that serves as mental models in
developing stupertype /subtype relationships.
a) Generalization:- The process of defining a more general entity type from a set of more specialized
entity types. Thus, generalization is bottom-up process.
Make Model
Ex:-
Make Model
Vehicl
e Cab
Vehicl
No. of Vehicle- name -type
e
Vehicle- name passenger id
id Capacit
s y

Price CAR Engine – Price TRUCK Engine –


displacemen displacemen
t t
The above two entities have many attributes in common, vehicle-ID, Vehicle-Name, price, Engine-
Displacement. The fact is that these entity types is really a version of more general entity type.
The more general entity type is named VEHICLE together with the resulting
Supertype/Subtype relationships as shown below. The entity CAR can have the specific attribute
No-of-passengers, while TRUCK has two specific attributes : capacity and cab type.
The generalization allows us to group entity types along with their common attributes and at
the same time. Preserve attributes that are peculiar to each subtype.

Make Model

Vehicl
e
Vehicle- name
id Engine –
displacement
Price
VEHICLE Cab
-type

No. of Capacit
passengers y

TRUCK
CAR

Generalization to VEHICLE Supertype

b) Specialization :- The process of defining one or more subtypes of the supertype and forming
supertype/subtype relationships. Specialization is a top-down process. The direct reverse of
generalization. Each subtype is formed based on some distinguishing characteristic such as
attributes or relationships specific to the subtype.
Ex : consider an Entity type PART that has several attributes.

You might also like