Notes and Study Materials

Subtype Discriminator

 

 

 

A subtype discriminator is the attribute in the supertype entity that determines to which subtype the supertype occurrence is related.

In the following figure, the subtype discriminator is the employee type (EMP_TYPE).It is common practice to show the subtype discriminator and its value for each subtype in the ER diagram, as seen in the Figure.

In the Figure, note that the supertype is related to a PILOT subtype if the EMP_TYPE has a value of “P.” If the EMP_TYPE value is “M,” the supertype is related to a MECHANIC subtype. And if the EMP_TYPE value is “A,” the supertype is related to the ACCOUNTANT subtype.

 

Subtype Discriminator

 

Disjoint and Overlapping Constraints

 

An entity supertype can have disjoint or overlapping entity subtypes.

 

 

For example, in the aviation example, an employee can be a pilot or a mechanic or an accountant. Assume that one of the business rules dictates that an employee cannot belong to more than one subtype at a time; that is, an employee cannot be a pilot and a mechanic at the same time.

Disjoint subtypes, also known as nonoverlapping subtypes, are subtypes that contain a unique subset of the supertype entity set; in other words, each entity instance of the supertype can appear in only one of the subtypes. For example, in the above Figure, an employee (supertype) who is a pilot (subtype) can appear only in the PILOT subtype, not in any of the other subtypes. Such disjoint subtypes are indicated by the letter d inside the category shape.

On the other hand, if the business rule specifies that employees can have multiple classifications, the EMPLOYEE supertype may contain overlapping job classification subtypes.

Overlapping subtypes are subtypes that contain nonunique subsets of the supertype entity set; that is, each entity instance of the supertype may appear in more than one subtype. 

 

 

For example, in a university environment, a person may be an employee or a student or both. In turn, an employee may be a professor as well as an administrator. Because an employee may also be a student, STUDENT and EMPLOYEE are overlapping subtypes of the supertype PERSON, just as PROFESSOR and ADMINISTRATOR are overlapping subtypes of the supertype EMPLOYEE. The following Figure illustrates overlapping subtypes with the use of the letter ‘o’  inside the category shape.

 

Specialization Hierarchy_Overlapping subtypes

You May Also Like:

Entity supertype and Subtype

Specialization Hierarchy

Difference between partial completeness and total completeness

Surrogate Primary key

Find Other DBMS Questions