Relationships and Keys
A relationship is an
association between two or more tables.
Relationships are expressed in the data
values of the primary and foreign keys.
A primary key is a column
or columns in a table whose values uniquely
identify each row in a table. A
foreign key is a column
or columns whose values are the same as
the primary key of another table. You
can think of a foreign key as a copy of
primary key from another relational
table. The relationship is made between
two relational tables by matching the
values of the foreign key in one table
with the values of the primary key in
another.
Keys are fundamental to the concept
of relational databases because they
enable tables in the database to be
related with each other. Navigation
around a relational database depends on
the ability of the primary key to
unambiguously identify specific rows of
a table. Navigating between tables
requires that the foreign key is able to
correctly and consistently reference the
values of the primary keys of a related
table. For example, the figure below
shows how the keys in the relational
tables are used to navigate from AUTHOR
to TITLE to PUBLISHER. AUTHOR_TITLE is
an all key table used to link AUTHOR and
TITLE. This relational table is required
because AUTHOR and TITLE have a
many-to-many relationship.

Next we will look at Data
Integrity. |