Databases Reference
In-Depth Information
Figure 3-6
Time Card
Employee
Pay Rate
Accrued
Vacation
Employee and associated entities.
a relationship between employees and managers. Each employee has a manager,
and each manager is responsible for one or more employees.
Breaking down one of these relationships, each time card is associated with a
unique employee, as shown in Figure 3-7. The time card is the referencing entity
and the employee is the referenced entity. The employee identifier is included
with each time card as a foreign key and ensures referential integrity, establish-
ing and maintaining that relationship and making sure that the referencing entity
is associated with a unique instance of the referenced entity. A foreign key is always
based on a unique value in the referenced entity, usually the entity's primary key.
Now, think about purchase orders. As you should remember, we created two
entities for each purchase order, one to contain the general header information and
the other to contain the individual line items. The obvious identifier for the header
information is the purchase order number. That same number could be embedded
in each line item row to associate the line item with the purchase order. It might
Figure 3-7
Time Card
Referencing
Entity
Employee
Referenced
Entity
Employee/time card relationship.
Search WWH ::




Custom Search