O'Reilly logo

SQL: Visual QuickStart Guide by Chris Fehily

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Foreign Keys

Information about different entity types is stored in different tables, so you must have a way to navigate between tables. The relational model provides a mechanism called a foreign key to associate two tables. A foreign key has these characteristics:

  • It’s a column (or group of columns) in a table whose values relate to, or reference, values in some other table.

  • It ensures that rows in one table have corresponding rows in another table.

  • The table that contains the foreign key is the referencing or child table. The other table is the referenced or parent table.

  • A foreign key establishes a direct relationship to the parent table’s primary key (or any candidate key), so foreign-key values are restricted to parent-key values that already ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required