To display information about keys that have been specified for a
table, access the Keys tab on the properties
window for the table. On the Keys tab, the
Keys pane on the left lists all of the keys that are associated with
the current table. Click a key in the list to see information about
it in the panes on the right: the Details pane and the Associated
Foreign Key Tables pane. The following display shows the Keys tab for a table named AUTHOR. A primary key named AUTHOR.Primary is selected on the
left. Information about this key is shown
on the right.
The default name for a primary key is currentTableName
.Primary, where currentTableName
is the name of the current table,
and Primary is a literal string.
For example, the default name for the primary key in the AUTHORS table
is AUTHOR.Primary.
The default name for a unique key is currentTableName
.UniqueKeyN
, where currentTableName
is the name
of the current table, UniqueKey is a literal string, and N
is an
iteration number added to the end.
When a primary key or a unique key is selected in the Keys pane, then the columns
that are specified for that key are
displayed in the Details pane. In the preceding display, the primary key consists
of the personid column in the AUTHOR table.
The Associated Foreign Key Tables pane displays any foreign keys that are associated
with a primary key or unique key that is selected in the Keys pane. The name of the
foreign key and the name of the table that contains the foreign key are displayed.
In the preceding
display, the primary key AUTHOR.Primary is referenced by a foreign key in the BOOKS
table.
The following
display shows the Keys tab for the BOOKS table, the table that contains the foreign key that was referenced.
The BOOKS table has two keys: a primary key named BOOKS.Primary and a foreign key
named AUTHOR.BOOKS, which is selected on the
left. Information about the foreign key is shown on the right.
The default name for a foreign key is foreignTableName
.currentTableName
, where foreignTableName
is the name of the table where the
foreign columns were originally created, and currentTableName
is the name of the current table. In the preceding display, the
foreign key is named AUTHOR.BOOKS, because the foreign columns originate
in the AUTHOR table, and the current table is the BOOKS table.
When a foreign key is selected in the Keys pane, the following values are displayed
in the Details pane:
-
Foreign Key Column displays the column or combination of columns in the current table
that references the corresponding column or combination of columns
in another table. In the preceding display, the foreign key column
is named author, which is the name of a column
in the BOOKS table.
-
Length displays the length of the Foreign Key Column.
-
Unique Key Column displays the corresponding column or combination of columns in the other table. In
the previous display, the unique key column is named personid.
-
Unique Key Table displays the name of the other table: AUTHOR.