Database
Database
Attribute Inheritance A subtype is an entity type in its own right. An entity instance of a subtype
represents the same entity instance of the supertype. For example, if “Therese Jones” is an occurrence
of the CONSULTANT subtype, then this same person is necessarily an occurrence of the EMPLOYEE
supertype. As a consequence, an entity in a subtype must possess not only values for its own attributes,
but also values for its attributes as a member of the supertype, including the identifier. Attribute
inheritance is the property by which subtype entities inherit values of all attributes and instance of all
relationships of the supertype.
When to Use Supertype/Subtype Relationships So, how do you know when to use a supertype/subtype
relationship? You should consider using subtypes when either (or both) of the following conditions are
present: 1. There are attributes that apply to some (but not all) instances of an entity type. For example,
see the EMPLOYEE entity type in Figure 3-2. 2. The instances of a subtype participate in a relationship
unique to that subtype. Figure 3-3 is an example of the use of subtype relationships that illustrates both
of these situations. The hospital entity type PATIENT has two subtypes: OUTPATIENT and RESIDENT
PATIENT. (The identifier is Patient ID.) All patients have an Admit Date attribute, as well as a Patient
Name. Also, every patient is cared for by a RESPONSIBLE PHYSICIAN who develops a treatment plan for
the patient