Professional Documents
Culture Documents
Chapter 03 - Foreign Key Relationships
Chapter 03 - Foreign Key Relationships
Objectives
The foreign key field and the primary key of the check table must share the same
domain.
Check Table
The table that is referenced by a foreign
key
In many cases, the value table and the check table will be the same
Check Value
Table Table
Check Value
Table Table
Cardinality
When creating foreign key relationships, you should always specify the cardinality
of that relationship
n : m
1 1
C C
CN
Check table
Maintain foreign
key type
Maintain cardinality n : m
If the primary key of a check table has multiple fields (i.e. it has a composite
primary key), some type of assignment must be made for each field when
creating a foreign key relationship.
Field-By-Field Assignment
When performing a field-by-field assignment, all key fields in the check table
are used to determine valid entries in the foreign key table.
When creating a partial foreign key, certain fields are flagged as generic.
These fields are ignored by the system when validating records that are inserted
into the foreign key table.
When creating a constant foreign key, certain fields are assigned a literal value
Only records in the check table with that value in the corresponding field are
used to determine whether records in the foreign key table are valid.
Demonstration
Creation of a new transparent table for holding the payroll data for employees in
an organization and establish a foreign key relationship with the employee table
created for the previous chapter.
Practice
Creation of a new transparent table for holding the payroll data for employees in
an organization and establish a foreign key relationship with the employee table
created for the previous chapter.
Summary
Questions