0% found this document useful (0 votes)
45 views28 pages

ITE 2422 - Week 4 - L6

This document discusses Enhanced Entity Relationship (EER) modeling. It defines key concepts of EER modeling including superclass/subclass relationships, specialization, generalization, disjointness constraints, and completeness constraints. These concepts allow database schemas to more precisely reflect data properties and constraints compared to basic Entity Relationship modeling. The document provides examples and notation for superclass/subclass hierarchies, inheritance, specialization vs. generalization, and how specialization can minimize null values and better represent subclass relationships.

Uploaded by

Tuan Ajreen
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)
45 views28 pages

ITE 2422 - Week 4 - L6

This document discusses Enhanced Entity Relationship (EER) modeling. It defines key concepts of EER modeling including superclass/subclass relationships, specialization, generalization, disjointness constraints, and completeness constraints. These concepts allow database schemas to more precisely reflect data properties and constraints compared to basic Entity Relationship modeling. The document provides examples and notation for superclass/subclass hierarchies, inheritance, specialization vs. generalization, and how specialization can minimize null values and better represent subclass relationships.

Uploaded by

Tuan Ajreen
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/ 28

ITE 2422 – Database Management Systems Week 4

ENHANCED
ENTITY-
R E L AT I O N S H I P
(EER)
MODELLING

LESSON 6
LEARNING OUTCOMES
• After completing this lesson, you will be able to design a EER diagram
to a real-world scenario.

• From this lesson you will be able to,


– Determine the difference between EER and ER diagrams
– Understand super classes and sub classes
– Apply specialization and generalization
– Apply distjointness constraint
– Apply completeness constraint

2
OUTLINE
• EER Vs. ER diagrams
• Super classes and sub classes
• Specialization and generalization
• Distjointness constraint
• Completeness constraint

This is an extension to the ER model that you learnt in previous lessons.


As students of IT, it is important to learn how to represent more
accurately database schemas using EER diagrams.Through EER diagrams
you will be able to reflect the data properties and constraints more
precisely.

3
ENHANCED ER (EER)
MODELLING
• Since the 1980s there has been an increase in the emergence of new
database applications with more demanding requirements.

• Basic concepts of ER modelling are not sufficient to represent the


requirements of the newer, more complex applications.

• Response is development of additional ‘semantic’ modelling concepts.

• Semantic concepts are incorporated into the original ER model and is


called the Enhanced Entity-Relationship (EER) model.
– That is EER includes all modelling concepts in ER

4
EER MODELLING
• EER is also Known as Extended ER model

• Created to design more accurate database schemas

• Reflect the data properties and constraints more precisely

• Additional concepts of EER model includes specialization / generalization,


and categorization.

5
SUPERCLASS AND
SUBCLASS
• A Superclass – is an entity type that includes distinct Subclasses that
require to be represented in a data model. The superclass is also
known as the parent class or base class.
• A Subclass is an entity type that has a distinct role and is also a
member of the Superclass
Vehicle
Vehicle is the Superclass and its
subclasses are Car, Truck and
Motorcycle.

Car Truck Motorcycle

6
SUPERCLASS AND
SUBCLASS EXAMPLES
• Member (superclass): Life_Member, Regular_Member,
Season_Member (subclasses)
• Staff (superclass): Full_Time_Staff, Part_Time_Staff (subclasses)

• It adds more semantic clarity


– If only Full_Time_Staff belongs to the Welfare_Society then it can be
represented as
• Belongs_To : <Full_Time_Staff, Welfare_Society>
• Not as Belongs_To : <Staff, Welfare_Society>
In the ER diagram, it would not have been possible to indicate this information
precisely.
7
INHERITANCE
• Subclass entity inherits all attributes and relationships of the superclass. The
subclass contains all the features and functionalities of the superclass class in
addition to its own.
• Attribute Inheritance
– An entity in a Subclass may possess subclass specific attributes, as well as those
associated with the Superclass.

Staff_No DOB
Employee
SName Address

Sales_
Technician Secretary
Personnel

Technical Sales_Area
Typing_Speed
grade 8
IS-A (‘IS A’) HIERARCHIES
Inheritance IS-A (instance) Relationship
• If we declare A is a B. Every A entity is considered to be a B entity.
• Secretary IS-A Employee

• Single inheritance results in a hierarchy (tree structure)


– Every subclass has only one superclass

• Multiple inheritances results in a lattice


– Subclass with more than one superclass
– E.g. Student → Student_Assistant <- Employee

9
IS-A RELATIONSHIP
Student sid

name

Generalization Is A Specialization

Undergraduate Graduate

This introduces two new terms, so, what is Generalization and Specialization?
SPECIALIZATION AND
GENERALIZATION
• Specialization
– The process of maximizing the differences between members of an entity by
identifying their distinguishing characteristics.
– Identify subclasses and their distinguishing characteristics (attributes,
relationships)
– Start with entity type then define subclasses by successive specialization

Top-Down
• Generalization
– The process of minimizing the differences between entities by identifying their
common characteristics.
– Aggregates entities into a superclass entity types by identifying their common
characteristics
Bottom up
11
SPECIALIZATION AND
GENERALIZATION
• CAR, TRUCK generalized into VEHICLE;

• Both CAR, TRUCK become subclasses of the superclass VEHICLE.


– We can view {CAR, TRUCK} as a specialization of VEHICLE

– Alternatively, we can view VEHICLE as a generalization of CAR and


TRUCK

12
SPECIALIZATION The circle with d
specifies that the
AND specializations are
disjoint. A member of
GENERALIZATION Undergrad entity set
NOT a member of the
Notations used: graduate entity set.

Student sid

name You can use this notation


also, but less information
d
can be given.

Student sid

name

Is A
Undergraduate Graduate

An alternative notation is the Union symbol Undergraduate Graduate


WHY DO WE DO
SPECIALIZATION? Specific (local)
attributes of
subclass

– Certain attributes may apply to some but not all


entities of the superclass
• E.g. Secretary – typing speed
Specific
• Thus, it minimizes Null Values relationship

– Some relationship types may be participated in only


by entities that are members of the subclass
• If only Full_Time Employee belongs to Welfare_Society

14
ACTIVITY 1
• Explain how specialization minimizes amount of null values?
• Explain it using a suitable example.

15
SPECIALIZATION
CONSTRAINTS
Rather than the usual cardinality symbols, the subclass association line is
labeled with specialization constraints.
Constraints are described along two dimensions: incomplete versus
complete, and disjoint versus overlapping.

Specialization constraints are:


• Disjointness (Inclusion) Constraints
• Completeness (Participation) Constraints

Disjointness and Completeness constraints are independent.


16
DISJOINTNESS CONSTRAINT
• Disjoint
– Members in different Subclasses from the same Superclass are
completely different.
– An entity can be a member of at most one of the subclasses of the
specialization
– Specified by d in EER diagram

• Non-Disjoint (overlap)
– Members in a Superclass can be enrolled in more than one Subclass
– That is the same entity may be a member of more than one subclass of
the specialization
– Specified by o in EER diagram

17
Specialization of employee entity into job roles and contract of
employment subclasses.

Subclasses may Address


have exclusive
EName Emp_No
sets of entities.
That is, an DOB
employee will be
Disjoint
either a fulltime
or a part-time
Constraints Employee
employee.

d d

Full_time_ Part_time_
Sales_ Permanent Temporary
Technician Secretary
Personnel
Salary_Sc Hourly_
ale Rate
Typing_Speed Holiday_
Tgrad Sales_Area Allowance 18
NON-DISJOINT
CONSTRAINTS Subclasses may have overlapping
sets of entities.
Musician That is, a musician can be both a
singer as well as a guitarist.

O = Overlap

Singer Guitarist

19
COMPLETENESS
CONSTRAINTS
• Total specialization
– All member in the Superclass must participate in either one Subclass.
– Shown in EER diagrams by a double line

• Partial specialization
– At least one member in the Superclass does not participate in the Subclass.
– Partial allows an entity not to belong to any of the subclasses
– Shown in EER diagrams by a single line

• Generalization usually is total because the superclass is derived from the


subclasses.

20
Specialization of employee entity into job roles and contract of
employment subclasses.

Address
EName Emp_No
Partial constraint- DOB
At least one staff
is not a
Employee
Technician,
Secretary, or
Sales Personnel Total
Constraints
d Partial d
Constraints

Full_time_ Part_time_
Sales Permanent Temporary
Technician Secretary
Personnel
Hourly_
Salary_Scale Rate
Typing_Speed Holiday_
Tgrade Sales_Area Allowance 21
SPECIALIZATION LATTICE
(MULTIPLE INHERITANCE)
Employee

d d

Technician Secretary Engineer Manager

Shared Full_time_ Part_time_


Subclass Permanent Temporary

Engineering_Manager
22
SPECIALIZATION LATTICE
• Multiple inheritance
– A subclass with more than one superclass
– If attribute (or relationship) originating in the same superclass inherited
more than once via different paths in lattice
• Included only once in shared subclass. E.g. Engineer-Manager

• Single inheritance
– Some models and languages limited to single inheritance

23
Multiple
Inheritance

24
ACTIVITY 2

• Draw the notation for superclass/subclass relationship where


– Partial and disjoint
– Total and disjoint
– Partial and overlapping
– Total and overlapping

25
BUILDING EER
Steps:
• Identify entity types.
• Identify relationship types.
• Determine cardinality and participation constraints of relationship
types.
• Identify and associate attributes with entity or relationship types.
• Determine candidate and primary key attributes.
• Determine Specialize / generalize entity types.
• Draw the EER Diagram.

26
ACTIVITY
Draw the EER diagram.
• The Motor Vehicle Branch administers driving tests and issues driver's licenses.
Any person who wants a driver's license must first take a learner's exam at
any Motor Vehicle Branch in their province.

• If s/he fails the exam, he can take the exam again any time after a week of the
failed exam date, at any branch.

• If s/he passes the exam, s/he is issued a license (type = learner's) with a unique
license number. A learner's license may contain a single restriction on it. The
person may take his driver's exam at any branch any time before the learner's
license expiry date (which is usually set at six months after the license issue
date).

• If he passes the exam, the branch issues him a driver's license. A driver's license
must also record if the driver has completed driver's education, for insurance
purposes.
27
SUMMARY
• In this lesson, we have learnt about the Enhanced ER (EER) diagrams.
Some of the semantic information in the real world cannot be
indicated in ER diagrams. As such, EER diagram was proposed.
• Super class/subclass relationships are indicated in the EER diagram.
• In the next lesson we will be learning about the relational model.

• Before you go to the next lesson, complete the self-


assessment Quiz 6 to check what you have learnt in the
Lesson 6.

28

You might also like