Refining All Foreign Keys

You now know that a primary key becomes a foreign key when you use it to establish a relationship between a pair of tables in a one-to-one or one-to-many relationship. As with any other key that you've worked with so far, a foreign key must comply with a specific set of elements. These elements are collectively known as the Elements of a Foreign Key.

Elements of a Foreign Key

  • It has the same name as the primary key from which it was copied. You should adhere to this rule unless there is an absolutely compelling reason not to do so. (Review the discussion of the Alias field specification element in Chapter 9. It provides an example of an occasion when you might decide to break this rule.) Consider the relationship ...

Get Database Design for Mere Mortals™: A Hands-On Guide to Relational Database Design, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.