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

Relationships

A relationship is an association established between common columns in two tables. A relationship can be:

  • One-to-one

  • One-to-many

  • Many-to-many

One-to-one

In a one-to-one relationship, each row in table A can have at most one matching row in table B, and each row in table B can have at most one matching row in table A. Because all the information in both tables simply could be stored in just one table, one-to-one relationships are used for practical, not theoretical, reasons: They’re used to segregate confidential information for security reasons, to speed queries by splitting monolithic tables, or to avoid inserting nulls into tables that contain columns with non-null values in a small subset of rows.

A one-to-one relationship is ...

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