Search⌘ K
AI Features

Relationships and Cardinality

Explore the concept of relationships and cardinality within database design, focusing on how entities connect using one-to-one, one-to-many, and many-to-many associations. Understand how these relationships provide structure and meaning in databases and how to represent them in ER diagrams, including the use of junction tables for complex links.

In our OnlineStore, a customer can place many orders over time, but each order is associated with only one customer.

Likewise, a product may be supplied by more than one supplier, and each supplier can supply many products. Simply storing lists of things does not make a database powerful; it is about connecting the entities that form the backbone of a database’s design. These connections are what we call a relationship. Without relationships, we’d have a bunch of meaningless data silos.

Understanding relationships and their cardinalities is essential for building effective data models. This lesson will help us confidently describe and implement these relationships in our ER diagrams and databases.

By the end of this lesson, we’ll be able to:

  • Understand what relationships are and why they are the glue of a database.

  • Define the different types of relationships using cardinality: one-to-one, one-to-many, and many-to-many.

  • Identify and interpret these relationships in a real-world database schema.

Let’s get started!

Relationship

At its core, a relationship ...