An entity instance of a subtype represents the same entity instance of the supertype.

A supertype is a generic entity type that has a relationship with one or more subtypes.

A subtype is a sub-grouping of the entities in an entity type that is meaningful to the organization and that shares common attributes or relationships distinct from other subgroups.

  • Subtypes inherit all supertype attributes

  • Subtypes have attributes that are different from other subtypes

Recommendations: Tables for Supertype and Subtype Entities

Create separate tables for the super type and all sub type entities for the following reasons:

  • Data integrity enforced at database level. (using NOT NULL column constraints)

  • Relationships can be accurately modeled and enforced including those which apply to only one subtype

  • Physical model closely resembles the logical data model.

  • It is easier to correlate the logical data model with the physical data model and support the logical data model enhancements and changes.

  • Physical data model reflects true business rules (for example, if there are some attributes or relationships mandatory for only one subtype.)

An entity instance of a subtype represents the same entity instance of the supertype.

Exam

Name___________________________________

1. Which of the following is a generic entity type that has a relationship with one or more subtypes?

A) Megatype

B) Subgroup

C) Supertype

D) Class

2. Given the following entities, which of the choices below would be the most complicated?

Automobile: VIN, EngineSize,NumberOfDoors, NumberOfPassengers,, FuelType, Transmission

SUV: VIN, EngineSize, NumberOfPassengers, NoWheelDrive, FuelType, Transmission

Truck: VIN, EngineSize, NoWheelDrive, FuelType, Transmission, Payload

A) Keep only the Truck entity type.

B) Define one vehicle entity type to hold all entities.

C) Define a supertype called vehicle and make each of the entities subtypes.

D) Define a separate entity type for each entity.

3. The property by which subtype entities possess the values of all attributes of a supertype is called:

A) attribute inheritance.

B) hierarchy reception.

C) generalization.

D) class management.

4. Subtypes should be used when:

A) supertypes relate to objects outside the business.

B) the instances of a subtype do not participate in a relationship that is unique to that subtype.

C) there are attributes that apply to some but not all instances of an entity type.

D) none of the above.

5. In the figure below, which of the following are subtypes of patient?

What is the difference between subtype and supertype?

A supertype is a generic entity type that has a relationship with one or more subtypes. A subtype is a sub-grouping of the entities in an entity type that is meaningful to the organization and that shares common attributes or relationships distinct from other subgroups.

Can a subtype be a supertype?

A supertype can have one or more subtypes, and a subtype can have one or more supertypes. A supertype can be a subtype of some other supertype, and a subtype can be a supertype of some other subtype. The relationship between a supertype and any of its subtypes involves the notion of substitutability.

Is an instance of the supertype could be more than one of the subtypes?

instance of a supertype may simultaneously instance of a supertype may simultaneously be a member of two (or more) subtypes. A bank has three types of accounts: checking, savings, and loan. Assume that each bank account must be a member of exactly one of these subtypes.

What rule specifies that an entity instance of a supertype can be a member of more than one subtype at a time?

The overlap rule specifies that if an entity instance of the supertype is a member of one subtype, it can simultaneously be a member of two (or more) subtypes. When subtypes are overlapping, an additional field must be added to the supertype to act as a discriminator.