Database Reference
In-Depth Information
have mistakenly entered employee ID number “100” for a given order when
you meant to enter “110.”
N
UMBER
foreign key field. (Note the setting for the Range of Values—this is one
good way to set this element.)
Figure 10.54. Logical Elements for the E
MPLOYEE
ID N
UMBER
foreign key field in the
ORDERS table
In order for you to see the significance of these modifications,
Figure 10.55
shows
the Logical Elements category from the Source Specification. (Recall that this ele-
ment is in the General Elements category; see
Figure 10.53
.)
•
It draws its values from the primary key to which it refers.
By definition, a foreign
key's range of values is limited to existing values of the primary key to which it
refers. For example, you cannot enter an invalid E
MPLOYEE
ID N
UMBER
into the
ORDERS table. Any E
MPLOYEE
ID N
UMBER
you enter into the ORDERS table
must first exist as an E
MPLOYEE
ID N
UMBER
in the EMPLOYEES table. This en-