Previous Topic: Defining Entity Subtypes and PartitioningNext Topic: Partitioning


Defining Entity Subtypes

The list of extended attributes for the entity type CUSTOMER in Defining Entity Subtypes and Partitioning shows that entities of the type CUSTOMER fall into two mutually exclusive groups: FOREIGN and DOMESTIC.

Note: For more information, see Entity Subtype and Partitioning.

The following illustration shows an Entity Relationship Diagram in which the entity type CUSTOMER has been separated into the entity subtypes FOREIGN CUSTOMER and DOMESTIC CUSTOMER.

Defining Entity Subtypes

The entity types FOREIGN CUSTOMER and DOMESTIC CUSTOMER are subtypes of the entity type CUSTOMER. In the illustration, the dashed box indicates a partitioning of the entity type CUSTOMER into subtypes. Another way of saying this is that the entity type CUSTOMER is a supertype to FOREIGN CUSTOMER and DOMESTIC CUSTOMER.

The name appearing inside the dashed box, NATIONALITY, is the name of the classifying attribute of the partitioning. Classifying the attributes are discussed later in this section.

Relationships and attributes particular to an entity subtype are mutually exclusive with relationships and attributes particular to other subtypes in the same partitioning. For example, a FOREIGN CUSTOMER may not have values for Tax ID Number and State of Incorporation, while a DOMESTIC CUSTOMER may not have values for Country Code or Import License Number.

Subtypes are said to inherit the relationships, attributes, and integrity conditions of their supertypes. For example, every FOREIGN CUSTOMER can have values for all relationships and attributes that are defined for CUSTOMER, and those defined specifically for FOREIGN CUSTOMER. Since each CUSTOMER must have a value for the attribute Number (it is a mandatory attribute), each FOREIGN CUSTOMER must also have a Number. Similarly, because each CUSTOMER place ORDERs, each FOREIGN CUSTOMER also place ORDERs.

The optionality of relationships and attributes of a subtype depends, on whether a given entity belongs to that subtype. In the previous illustration, for example, assume that Country Code is defined as a mandatory attribute of the subtype FOREIGN CUSTOMER. Here, every FOREIGN CUSTOMER must have an attribute value for Country Code. A DOMESTIC CUSTOMER cannot have a value for Country Code.