In data modeling (ER/EE-R), is a subtype discriminator defined on the supertype as an attribute whose value determines to which subtype(s) a particular supertype instance belongs?

Difficulty: Easy

Correct Answer: Correct

Explanation:


Introduction / Context:
A common pattern in enhanced entity–relationship (EE-R) modeling is to represent inheritance using a supertype and one or more subtypes (specializations). Designers often include a “subtype discriminator” on the supertype. This question checks whether you understand what that discriminator attribute is and how it is used during design and implementation.



Given Data / Assumptions:

  • The model uses a supertype (for example, Person) and several subtypes (such as Employee, Customer, Contractor).
  • A single attribute is stored on the supertype to indicate subtype membership.
  • We are talking about logical data modeling concepts, independent of a specific DBMS.


Concept / Approach:
The subtype discriminator (sometimes called a type attribute, category code, or specialization indicator) is an attribute that lives on the supertype entity. Its value determines which subtype(s) a given instance belongs to. For disjoint specializations, a single-value code (for example, 'E' or 'C') is sufficient. For overlapping specializations, implementations may use a multi-valued indicator, multiple Boolean flags (is_employee, is_supplier), or a link table to express membership in more than one subtype.



Step-by-Step Solution:

Identify the supertype and its subtypes in the conceptual model.Place a discriminator attribute on the supertype (for example, person_type).Define allowed values and their mapping to subtypes (for example, E → Employee, C → Customer, B → both if overlapping).Use the discriminator during data validation and routing to enforce correct subtype-specific attributes and behavior.


Verification / Alternative check:
Review a sample row in the supertype table. The discriminator value should deterministically imply which subtype table(s) contain the same primary key. In disjoint designs, each supertype key appears in exactly one subtype table. In overlapping designs, it may appear in several.



Why Other Options Are Wrong:

  • “Incorrect” contradicts established EE-R practice.
  • “Only in UML, not in ER modeling” is wrong; ER/EE-R texts explicitly discuss subtype discriminators.
  • “Applies only when subtypes are disjoint” is false; overlapping specializations also use discriminators, although the encoding can be multi-valued or multi-attribute.


Common Pitfalls:
Using ambiguous codes without a controlled vocabulary, forgetting to enforce that subtype-specific attributes are populated only when the discriminator allows it, or hard-coding values in application logic instead of centralizing them in constraints or reference tables.



Final Answer:
Correct

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion