0% found this document useful (0 votes)
15 views23 pages

Enhanced: Entity Relationship Modelling

Uploaded by

tbcard49
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views23 pages

Enhanced: Entity Relationship Modelling

Uploaded by

tbcard49
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

(Enhanced) Entity

Relationship Modelling
Dr. Enosha Hettarachchi
(Enhanced) Entity Relationship Modelling

 EER Modeling is important for new applications of


database technology such as
– Engineering design and manufacturing
(CAD/CAM)
– Geographical Information Systems (GIS)

2
Superclasses and Subclasses
 Subclasses and Superclasses
– a subclass entity type is a specialised type of superclass entity
type
– a subclass entity type represents a subgrouping of superclass
entity type’s instances
e.g. undergraduates and postgraduates are subclasses of the
student superclass

3
Superclasses and Subclasses
 The relationship between a superclass and any one of its
subclasses is called superclass/subclass relationship.

 superclass/subclass relationship is also called an IS-A


relationship.
e.g. Engineer is an employee.

4
Basic notation for supertype/subtype
relationships- Traditional EER notation

5
Employee supertype with three
subtypes

6
Inheritance
 An important concept associated with subclass is that of
type inheritance.

 Since an entity in the sub class represents the same real


world from the superclass, it should possess values for its
specific attributes as well as values of its attributes as a
member of the superclass.

7
Inheritance
 We say that an entity that is a member of a subclass
inherits all the attributes of the entity as a member of the
superclass.

 The entity also inherits all the relationships in which the


superclass participates.

8
Specialisation
 Specialisation
– the process of defining a set of more specialised entity types of
an entity type
e.g. the set of subclasses {secretary, engineer, technician} is a
specialization of the super class Employee.

9
Specialisation

Employee

Secretary Technician Engineer

TypingSpeed
TGrade EngType

10
Specialisation
 Specialization process allows to do followings
– Define a set of sub classes of an entity type.
– Establish additional specific attributes with each subclass
– Establish additional specific relationship types between each
subclass and other entity types or other subclasses.

11
Generalisation
 Generalisation
– The process of defining a generalised entity type from a set of
entity types
– Suppresses the differences among several entity types, identify
their common features and generalize them into a single
superclass.
- Inverse of the specialization process.

12
Generalisation
NoOfAxels Tonnage

MaxSpeed NoOfPassengers

Price TRUCK
Price CAR
Vehicleid LicensePlateNo
Vehicleid LicensePlateNo

LicensePlateNo VEHICLE Vehicleid

Price

d
NoOfPassengers NoOfAxels

MaxSpeed TRUCK 13 Tonnage


CAR
Constraints on Specialisation &
Generalisation
 Disjointness
– Overlap
the same entity instance may be a member
of more than one subclass of the
specialization
(eg: a person is a student who is also a part-time employee -
Both can function at the same time )

– Disjoint
the same entity instance may be a member
of only one subclass of the specialization
(eg: An employee cant be both a secretary and an engineer -
14
Both can’t function at the same time)
Constraints on Specialisation &
Generalisation
Overlap

Person

Employee Student

salary Department
15
Constraints on Specialisation &
Generalisation

Disjoint

Employee

Secretary Technician Engineer

TypingSpeed
TGrade EngType
17
Disjoint rule

18
Constraints on Specialisation &
Generalisation
 Completeness
– Total
every entity instance in the superclass must
be a member of some subclass in the
specialization

– Partial
an entity instance in the superclass need
not be a member of any subclass in the
specialisation

20
Examples of completeness constraints
Total specialization rule

21
Partial specialization rule

22
Constraints on Specialisation &
Generalisation
 Disjointness and completeness are independent and
therefore we have the following four possible constraints
on specialisation
– Disjoint, total
– Disjoint, partial
– Overlapping, total
– Overlapping, partial

23
Category

 A category is a subclass of the union of two or


more superclasses that can have different keys
because they can be of different entity types.

BName
BANK

PERSON COMPANY

personid compid
U

24
OWNER
END

You might also like