Notes and Study Materials

Attribute Inheritance in EEE diagrams:

 

 

The property of inheritance enables an entity subtype to inherit the attributes and relationships of the supertype. As discussed earlier, a supertype contains those attributes that are common to all of its subtypes. In contrast, subtypes contain only the attributes that are unique to the subtype.

For example, the following Figure illustrates that pilots, mechanics, and accountants all inherit the employee number, last name, first name, middle initial, hire date, and so on from the EMPLOYEE entity.

However, the following Figure also illustrates that pilots have attributes that are unique; the same is true for mechanics and accountants. One important inheritance characteristic is that all entity subtypes inherit their primary key attribute from their supertype.

 


Attribute Inheritance in EEE diagrams

Note in the above Figure that the EMP_NUM attribute is the primary key for each of the subtypes. Entity subtypes inherit all relationships in which the supertype entity participates.

For example, The above Figure shows the EMPLOYEE entity supertype participating in a 1:M relationship with a DEPENDENT entity. Through inheritance, all subtypes also participate in that relationship. In specialization hierarchies with multiple levels of supertype/subtypes, a lower-level subtype inherits all of the attributes and relationships from all of its upper-level supertypes.