Database Reference
In-Depth Information
to the table associated with E . The primary key of T is composed of all
of its attributes.
Suppose that in Fig. 2.1 , the attribute Phone of Customers is multival-
ued. In this case, the attribute is mapped to a table CustomerPhone with
attributes CustomerID and Phone both composing the primary key.
Rule 7: A generalization relationship between a supertype E 1 and subtype
E 2 can be dealt with in three different ways:
Rule 7a: Both E 1 and E 2 are mapped, respectively, to tables T 1 and T 2 ,
in which case the identifier of E 1 is propagated to T 2 . A referential
integrity constraint relates this identifier to T 1 .
Rule 7b: Only E 1 is associated with a table T 1 , which contains all
attributes of E 2 . All these attributes become optional in T 1 .
Rule 7c: Only E 2 is associated with a table T 2 ,inwhichcasea l
attributes E 1 are inherited in T 2 .
As an example, the possible translations of the generalization given in
Fig. 2.3 are shown in Fig. 2.6 .
a
b
c
Permanent
Employees
EmployeeID
FirstName
LastName
Title
Employees
Employees
EmployeeID
FirstName
LastName
Title
EmployeeID
FirstName
LastName
Title
Salary
Salary (0,1)
ContractExpiration (0,1)
ContractAmount (0,1)
Permanent
Employees
EmployeeID
Salary
Temporary
Employees
EmployeeID
FirstName
LastName
Title
Temporary
Employees
EmployeeID
ContractExpiration
ContractAmount
ContractExpiration
ContractAmount
Fig. 2.6 Three possible translations of the schema in Fig. 2.3 .( a ) Using Rule 7a. ( b )
Using Rule 7b. ( c )UsingRule7c
Note that the generalization type (total vs. partial and disjoint vs.
overlapping) may preclude one of the above three approaches. For example,
the third possibility is not applicable for partial generalizations. Also,
note that the semantics of the partial, total, disjoint, and overlapping
characteristics are not fully captured by this translation mechanism. The
conditions must be implemented when populating the relational tables. For
example, assume a table T and two tables T 1 and T 2 resulting from the
 
Search WWH ::




Custom Search