DBMS Chapter5
DBMS Chapter5
Inheritance
Enables an entity subtype to inherit attributes and relationships of the
supertype
All entity subtypes inherit their primary key attribute from their supertype
At the implementation level, supertype and its subtype(s) maintain a 1:1
relationship
Entity subtypes inherit all relationships in which supertype entity
participates
Lower-level subtypes inherit all attributes and relationships from its
upper-level supertypes
Subtype Discriminator
Attribute in the supertype entity that determines to which entity subtype
the supertype occurrence is related
Default comparison condition is the equality comparison
In some situations the subtype discriminator is not necessarily based on
an equality comparison
Disjoint and Overlapping Constraints
Disjoint subtypes : contain a unique subset of the supertype entity set
- Known as nonoverlapping subtypes
- Implementation is based on the value of the subtype discriminator
attribute in the supertype
Overlapping subtypes : contain nonunique subsets of the supertype entity set
- Implementation requires the use of one discriminator attribute for each
subtype
Completeness Constraint
Specifies whether each supertype occurrence must also be a member of at
least one subtype
Partial completeness: not every supertype occurrence is a member of a
subtype
Total completeness: every supertype occurrence must be a member of at
least one subtypes
Entity Clustering :
Formed by combining multiple interrelated entities into a single, abstract
entity object
General rule: avoid the display of attributes to eliminate complications
that result when the inheritance rules change
Selecting Primary Keys
◦ Primary keys: single attribute or a combination of attributes
◦ Uniquely identifies each entity instance
◦ Guarantees entity integrity
◦ Works with foreign keys to implement relationships
◦ Natural key or natural identifier: real-world identifier used to uniquely
identify real-world objects
- Familiar to end users and forms part of their day-to-day business
vocabulary
- Used as the primary key of the entity being modelled
- Usually, if an entity has a natural identifier, a data modeler uses it as a
primary key of the entity being modeled
- Generally, most natural keys make acceptable primary key identifiers.
Fan trap: A design trap that occurs when one entity is in two 1:M relationships
to other entities
- Produces an association among other entities not expressed in the model
Design Case 4: Redundant Relationships
Occur when there are multiple relationship paths between related entities (1:M
associative entity 1:M relationship)
◦ Must remain consistent across the model
◦ May help simplify the design in some cases