Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

The Enhanced ER Model and

Operational Constraints
Supertypes and Subtypes
• Supertype (example: Employee)
– a generic entity that has a relationship with one or more subtypes
• Subtype (example: Manager)
– a subgrouping of a supertype entity that is meaningful to an
organization
– shares all attributes of its supertype, but also has unique attributes of
its own and/or :
– has relationships with other entities distinct from those of other
subtypes
Attribute Inheritance
• The property by which subtype entities inherit values of all
attributes of the supertype.
• This important property makes it unnecessary to include
supertype attributes or relationships redundantly with the
subtypes.
Basic Notation
Supertype/Subtype Rules
Use this type of relationship when either (or both) of the
following are present:
1. When there are attributes that apply to some (but not all) of
the instances of an entity type
2. When the instances of a subtype participate in a relationship
unique to that subtype
Relationships and Subtypes
• Relationships at the supertype level indicate that all subtypes
will participate in the relationship
• The instances of a subtype may participate in a relationship
unique to that subtype. In this situation, the relationship is
shown at the subtype level
For Example…
Generalization and Specialization

• Generalization: The process of defining a more general entity


type from a set of more specialized entity types. BOTTOM-UP
• Specialization: The process of defining one or more subtypes
of the supertype and forming supertype/subtype relationships.
TOP-DOWN
Supertype / Subtype Constraints

• Completeness • Disjointness
Addresses the Addresses the question
question of whether of whether an instance
an instance of a of a supertype may
supertype must also simultaneously be a
be a member of at member of two (or
least one subtype more) subtypes
Completeness Constraint Rules
• Total Specialization Rule (Double-line notation)
Specifies that each entity instance of the supertype must be a member of some
subtype in the relationship (Example: all STUDENTS are either UNDERGRADUATE or
GRADUATE students)

• Partial Specialization Rule (Single-line notation)


Specifies that an entity instance of the supertype is allowed to not belong to any
subtype (Example: FACULTY and STAFF are not the only possible members of the
entity EMPLOYEE)
Example 1
Example 2
Disjointness Constraint Rules
• Disjoint Rule: An instance of the supertype can be only ONE of
the subtypes
– Denoted by a ‘d’ in the circle
• Overlap Rule: An instance of the supertype could be more than
one of the subtypes
– Denoted by an ‘o’ in the circle
Disjoint Example 1
Overlap Example 1
Impact on Subtype Discriminators
• Subtype Discriminator: An attribute of the supertype whose values
determine the target subtype(s)
– Disjoint – a simple attribute with alternative values to indicate the possible
subtypes
– Overlapping – a composite attribute whose subparts pertain to different
subtypes. Each subpart contains a Boolean value to indicate whether or not the
instance belongs to the associated subtype
Disjoint w/ Subtype Discriminators
Overlap
Operational Constraints
• Rules that constrain on-going operations of a business
• Stored in a constraint base and accessed during transaction
processing
• No common notation
Example

Structural
constraints

Operational
constraint
Example 2

Business Rule 1:
For a faculty
member to be
assigned to teach
a section of a
course, the
faculty member
must be qualified
to teach the
course for which
that section is
scheduled.
Example 3

Business Rule 2: For a


faculty member to be
assigned to teach a
section of a course,
the faculty member
must not be assigned
to teach a total of
more than three
course sections.

You might also like