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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access