Adding a Foreign Key

How To

Creating a foreign key comprises several phases. First, includes selecting a table that contains referencing columns, selecting columns, and naming a foreign key.

The foreign key columns in the referencing table must map exactly to the primary key columns or unique index columns of the referenced table. The number of columns used in the foreign key and the schema of those columns must be the same in both the referencing and referenced tables.