Types of Relationships

Before you begin to establish relationships between tables in the database, you must know what types of relationships can exist between a given pair of tables. Knowing how to identify them properly is an invaluable skill for designing a database successfully.

There are three specific types of relationships that can exist between a pair of tables: one-to-one, one-to-many, and many-to-many. The tables participate in only one type of relationship at any given time. (You'll rarely need to change the type of relationship between a pair of tables. Only major changes in either of the table's structures could cause you to change the relationship.)

Note

The discussion for each type of relationship begins with a generic example ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.