Use the Foreign Keys page of the Alter Table notebook to add foreign keys
to your table. A foreign key is a column or set of columns in a table
whose values are required to match at least one primary key value of a row of
its parent table. A referential constraint is the rule that the values
of the foreign key are valid only if either:
- They appear as values of a parent key (primary key).
- Some component of the foreign key is null.
You can add, change, or remove new foreign keys for your table.
Fields and controls
Authorities and privileges

To add new foreign keys:
- Open the Alter Table notebook.
- Click on the Foreign Keys tab.
- Click on Add. The Add Foreign Key window opens.
- In the Table schema box, specify the
schema of the parent table.
- In the Table name box, specify the name
of the parent table. The Primary key box displays a list of
the primary key columns defined for the parent table.
- In the Available columns box, select a column or columns that
you want to define as a foreign key. Each column you select must match
a primary key column for the parent table in meaning and data type.
- Click on the > push button to move the selected column or
columns to the Foreign key box.
- In the On delete box, specify what action
is to take place on the dependent table when a row is deleted from the parent
table.
- In the On update box, specify what action
is to take place on the dependent table when a row of the parent table is
updated.
- Optional: In the Constraint name
field, type a name for the constraint that you're defining.
- Click on Apply to add the new foreign key.
- Repeat steps 4 through 11 to add another foreign key to your table.
- Click on Cancel to close the Add Foreign Key window.
- If you do not want to make any additional changes to the table, click on
OK to alter your table and close the Alter Table notebook.
Otherwise, continue on to one or more of the optional tasks.

Related information
- Alter Table -- Overview
- Foreign keys -- See the SQL Reference
- Referential constraints -- See the SQL Reference
- Schemas -- See the SQL Reference
- Parent table -- See the SQL Reference
- Dependent table -- See the SQL Reference