Databases Reference
In-Depth Information
Exhibit 20-2. Status-based subtype.
SHIPPED-QTY is not available early in the life cycle of ORDER. Recently
received may not have a WAREHOUSE assigned as a source point.
By defining a subtype entity (e.g., SHIPPED ORDER) these three optional
properties are brought under a single definition that states when they are
to be required. Both SHIPPED-DATE and SHIPPED-QTY are required
attributes of the subtype and the outbound relationship to WAREHOUSE is
now required. The warehouse assignment, shipment date, and shipment
quantity are not optional for an order. What is optional is whether an order
is shipped at all. Once shipped, the warehouse, date, and quantity are then
required. When the subtype definition is added, the model is clarified (e.g.,
SHIPPED-DATE is never present without SHIPPED-QTY and supplemented
with facts that are not present in the model without the subtype (e.g., the
average cardinality of the subtype relationship represents the percentage
of orders that are shipped).
In type-based subtype modeling, distinctions are made between differ-
ent instances of an entity. Employees have an annual salary or an hourly
rate based on whether they are exempt or nonexempt employees (see
Exhibit 3). At the supertype level both attributes must be optional. When
the data modeler uses subtype entities, each attribute can be required
within a narrower context. Because an employee can be only one of these
types, the subtype entities are exclusive and exhaustive. The modeler can
also establish other subtype relationships for the same entity independent
of other established subtype schemas. Each view serves an appropriate
purpose if it continues to add to the model's precision. Entities are often
combinations of both type-based and status-based subtype schemas.
Search WWH ::




Custom Search