Database Reference
In-Depth Information
Figure 10.53. General Elements for the E MPLOYEE ID N UMBER foreign key field in the
ORDERS table
You'll also adjust five elements in the Logical Elements category for the foreign
key field specification.
a. Key Type: Set this element to “Foreign.” This is a rather obvious change, but
one that you can accidentally overlook if you're not careful.
b. Uniqueness: You designate this element as “Non-unique” because you want to
be able to associate a single foreign key value with any number of records in
the parent table. In terms of our example, you want to be able to associate a
specific employee with any number of orders. If you set this to “Unique” in-
stead, you could associate a given employee with one order only, which would
greatly limit his or her sales potential! (In the case of a one-to-one relationship,
however, you'll designate this element as “Unique” because you want to asso-
ciate a single foreign key value in the child table with only one record in the
parent table.)
c. Values Entered By: Unlike the parent primary key, you (or a user) will enter
values into the foreign key; therefore, you set this element to “User.”
d. Range of Values: You must set this element in such a way that you (or a user)
can enter only existing values from the parent primary key. (You'll learn more
about this and see a good example in just a moment.)
e. Edit Rule: You normally set this to “Enter Now, Edits Allowed,” although
there might be instances (such as when the foreign key comes from a valida-
tion table) when you can set this to “Enter Later, Edits Allowed.” Allowing ed-
its of foreign key values enables you to fix mistakes. For example, you might
Search WWH ::




Custom Search