SQLEditor Icon

Create a table level Foreign Key

A table level foreign key appears as a separate entry in a table. Composite foreign keys containing more than one pair of columns must be created using table level foreign keys.

You choose columns in one table (the parent table) and then choose which columns in a second table (the target table) that these should refer to.

Each column in the first table should match a column in the second table.

  1. Click on the table you want to add the foreign key to
  2. Choose ObjectAdd Foreign Key. A new foreign key entry will appear in the table
  3. Drag from the new foreign key entry to the target (referenced) table
  4. Move to the inspector and look at the list of column pairs
  5. Click the + (plus) button to add a new column pair
  6. Choose the columns in the source and target tables that you wish to pair
  7. Add further column pairs if required
  8. Specify a constraint name for the foreign key (if required)