Database Reference
In-Depth Information
Figure 11.15. A relationship diagram for the SUPPLIERS and STATES tables
Now that the S
TATE
field is a foreign key in the SUPPLIERS table, make certain that it
conforms to the Elements of a Foreign Key (as outlined in
Chapter 10
)
and set its field
specification in the appropriate manner. Then set the relationship's characteristics in this
manner.
•
Deletion Rule:
Define a Restrict deletion rule for this relationship. You
do not
want
to delete a state in the STATES table that is being referenced by records in the
SUPPLIERS table.
•
Type of Participation:
Designate an Optional type of participation for the
SUPPLIERS table and a Mandatory type of participation for the STATES table.
Although it's unnecessary for the SUPPLIERS table to contain any records before
you can enter a new record in the STATES table, there must be
at least
one record
in the STATES table before you can enter records into the SUPPLIERS table.
•
Degree of Participation:
Assign a (1,1) degree of participation for the STATES
table; as you already know, there must be at least one record in the STATES table
before you can enter records into the SUPPLIERS table. Assign a (0,N) degree of
participation for the SUPPLIERS table; any number of records in this table can be
associated with a particular record in the STATES table.
Next, modify the Range of Values element of the field specification for the S
TATE
field in
the SUPPLIERS table using a setting such as this:
Any value within the S
TATE
field of the STATES table.