You are on page 1of 19

The Enhanced Entity

Relationship Model
Database Management System I
Objectives of this Chapter
• Define and differentiate the supertype relationship from the subtype
relationship.
• Specify the use of the generalization and specialization.
• Explain the different constraints to be applied to the
supertype/subtype relationship.
• Identify and know the uses of the classifications of the completeness
and disjointness constraint, as well as the subtype discriminators.
Supertype vs. Subtype
SUPERTYPE SUBTYPE
• An entity type which is in a • A specialized entity type which is
generic form and is related to based on the classification of its
one or more subtypes. supertype.
• It contains the common/shared • It contains the attributes unique
attributes from each of the to a particular subtype only.
subtypes.
• Usually includes the identifier.
Supertype/Subtype Notation
SUPERTYPE ATTRIBUTE INHERITANCE
(Common attributes Generic entity
• Each of the subtype entities
from each of its type inherits all the values of the
subtype) attribute of its supertype.
All instances • The instance of each of the
should subtypes is also an instance of
participate in
the relationship
its supertype.

RELATIONSHIPS
Only a particular • All subtypes will participate in
specialized entity
will participate in
the supertype relationship.
the relationship • Relationships established at the
subtype level are unique to a
SUBTYPE 1 SUBTYPE 2 particular subtype only.
Specialized
(Unique attributes to (Unique attributes to entity type
subtype 1) subtype 2)
EMPLOYEE

Employee_ID
Employee_Name is_assigned_to
Employee_Address DEPARTMENT
(Street, Brgy., City,
Province, Postal_Code) Department_Code
Department_Name
Date_Hired consists_of

Both the Faculty and the Staff are


assigned to a specific department.

Only the Faculty teaches at least


one subject.

SUBJECT FACULTY
is_taught_by STAFF
Subject_Code Position
Subject_Title Rank Monthly_Salary
Subject_Description teaches Hourly_Rate
Generalization and Specialization
GENERALIZATION SPECIALIZATION

• Follows the BOTTOM-UP Approach. • Follows the TOP-DOWN Approach.


• Refers to the process of identifying a • Refers to the process of identifying
generic entity type from a defined set a set of specialized entity types
of specialized entity types. from a defined generic entity type.
• All of the common attributes of the • Each of the specialized entity types
specialized entity type will be used to must contain attribute/s unique to
formulate a new generic entity type.
that entity type only.
• Applied on a group of entities.
• Applied on a single entity.
GENERALIZATION
FACULTY
STAFF DEAN
Employee_ID
Employee_ID Employee_ID
Employee_Name
Employee_Name Employee_Name
Employee_Address
Employee_Address Employee_Address
(Street, Brgy., City,
(Street, Brgy., City, (Street, Brgy., City,
Province, Postal_Code)
Province, Postal_Code) Province, Postal_Code)
Date_Hired
Date_Hired Date_Hired
Position
Monthly_Salary
Rank
Hourly_Rate

All of these entity types has common attributes in it.


EMPLOYEE

Employee_ID
All of the common Employee_Name
Employee_Address
attributes are placed in
(Street, Brgy., City,
its supertype. Province, Postal_Code)
Date_Hired

The entity Dean has no unique


attributes in it, therefore, it is
FACULTY not specified in the diagram.
STAFF
Position
Monthly_Salary
Rank
Hourly_Rate
SPECIALIZATION
STUDENT

Student_ID
Student_Name
Student_Address
(Street, Brgy., City,
Province, Postal_Code)
Admission_Date
School_Year Undergraduate Student
Semester
Graduate Student Graduation_Date
STUDENT

Student_ID
Student_Name
Student_Address
(Street, Brgy., City,
Province, Postal_Code)
Admission_Date
Supertype STUDENT
with 2 subtypes – the
GRADUATE and the
UNDERGRADUATE

GRADUATE UNDERGRADUATE

Graduation_Date School_Year
Semester
COMPLETENESS CONSTRAINT
- Determines whether the supertype must be a member of at least one
of the subtypes.

TOTAL SPECIALIZATION RULE PARTIAL SPECIALIZATION RULE


• States that the supertype must • States that the supertype may
belong to one or more subtypes. not belong to any of its
• Symbolized by a double line. subtypes.
• Symbolized by a single line.
STUDENT
TOTAL
Student_ID
Student_Name SPECIALIZATION
Student_Address
(Street, Brgy., City,
RULE
Province, Postal_Code)
Admission_Date

The STUDENT must


either be a GRADUTE or
an UNDERGRADUATE

GRADUATE UNDERGRADUATE

Graduation_Date School_Year
Semester
EMPLOYEE PARTIAL
Employee_ID SPECIALIZATION
Employee_Name
Employee_Address
RULE
(Street, Brgy., City,
Province, Postal_Code)
Date_Hired

The EMPLOYEE could be


a FACULTY, a STAFF, or
neither of these types

FACULTY
STAFF
Position
Monthly_Salary
Rank
Hourly_Rate
DISJOINTNESS CONSTRAINT
- Determines whether the supertype may simultaneously be a member
of two or more subtypes.

DISJOINT RULE OVERLAP RULE


• States that the supertype can • States that the supertype could
only be one of the subtypes. be a member of more than one
• Symbolized by a small letter d. of the subtypes.
• Symbolized by a small letter o.
STUDENT

Student_ID
Student_Name
Student_Address
DISJOINT RULE
(Street, Brgy., City,
Province, Postal_Code)
Admission_Date

A STUDENT can either be a


GRADUATE or UNDERGRADUATE
but not both. d

GRADUATE UNDERGRADUATE

Graduation_Date School_Year
Semester
EMPLOYEE

Employee_ID
Employee_Name
OVERLAP RULE
Employee_Address
(Street, Brgy., City,
Province, Postal_Code)
Date_Hired

An EMPLOYEE may be both a


FACULTY and a STAFF. o

FACULTY
STAFF
Position
Monthly_Salary
Rank
Hourly_Rate
SUBTYPE DISCRIMINATORS
- An attribute indicated on the supertype that indicates the subtypes of
the entity.

DISJOINT OVERLAPPING
• A simple attribute that indicates • A composite attribute whose
the possible values of the subparts indicates a Boolean value
subtypes. that determines whether or not
the instance belongs to the
associated subtype.
STUDENT

Student_ID
Student_Name
Student_Address
DISJOINT
(Street, Brgy., City,
Province, Postal_Code)
Admission_Date
A simple attribute Student_Type
indicating the possible
different values of the Student_Type =
subtype.

d
“G” “UG”

GRADUATE UNDERGRADUATE

Graduation_Date School_Year
Semester
EMPLOYEE

Employee_ID
Employee_Name
Employee_Address
OVERLAPPING
(Street, Brgy., City,
Province, Postal_Code)
A composite attribute with subparts Date_Hired
indicating the Boolean value to Employee_Type
determine if the supertype belongs to (Faculty?, Staff?)
a particular subtype.
Employee_Type =

o
Faculty? = “Y” Staff? = “Y”

FACULTY
STAFF
Position
Monthly_Salary
Rank
Hourly_Rate

You might also like