Professional Documents
Culture Documents
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
SUBJECT FACULTY
is_taught_by STAFF
Subject_Code Position
Subject_Title Rank Monthly_Salary
Subject_Description teaches Hourly_Rate
Generalization and Specialization
GENERALIZATION SPECIALIZATION
Employee_ID
All of the common Employee_Name
Employee_Address
attributes are placed in
(Street, Brgy., City,
its supertype. Province, Postal_Code)
Date_Hired
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.
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
FACULTY
STAFF
Position
Monthly_Salary
Rank
Hourly_Rate
DISJOINTNESS CONSTRAINT
- Determines whether the supertype may simultaneously be a member
of two or more subtypes.
Student_ID
Student_Name
Student_Address
DISJOINT RULE
(Street, Brgy., City,
Province, Postal_Code)
Admission_Date
GRADUATE UNDERGRADUATE
Graduation_Date School_Year
Semester
EMPLOYEE
Employee_ID
Employee_Name
OVERLAP RULE
Employee_Address
(Street, Brgy., City,
Province, Postal_Code)
Date_Hired
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