Netside where knowledge is shared, ideas are spread.

[Notes] CSCI 585 DB Advanced Data Modeling

Credit to: Prof. Saty Raghavachary, CSCI 585, Spring 2020

outline

  • Extended Entity Relationship (EER) model

Entity Supertypes and Subtypes

  • Entity supertype: Generic entity type related to one or more entity subtypes
    • Contains common characteristics
  • Entity subtype: Contains unique characteristics of each entity subtype
  • Criteria to determine the usage
    • There must be different, identifiable kinds of the entity in the user’s environment
    • The different kinds of instances should each have one or more attributes that are unique to that kind of instance

Specialization Hierarchy

  • Depicts arrangement of higher-level entity supertypes and lower-level entity subtypes
  • Relationships are described in terms of “is-a” relationships
  • Subtype exists within the context of a supertype
  • Every subtype has one supertype to which it is directly related
  • Supertype can have many subtypes
  • Provides the means to:
    • Support attribute inheritance
    • Define a special supertype attribute known as the subtype discriminator
    • Define disjoint/overlapping constraints and complete/partial constraints

Figure 5.2 - Specialization Hierarchy

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

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

Figure 5.4 - Specialization Hierarchy with Overlapping Subtypes

Completeness Constraint

  • Specifies whether each supertype occurrence must also be a member of at least one subtype
  • Types
    • Partial completeness: Not every supertype occurrence is a member of a subtype
    • Total completeness: Every supertype occurrence must be a member of any

Table 5.2 - Specialization Hierarchy Constraint Scenarios