...

/

Relationships and Cardinality

Relationships and Cardinality

Understand what relationships are and define their different types using cardinality.

We'll cover the following...

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 is simply an association between two or more entities.

It describes how entities interact or are connected to each other. For a database to be useful, it must accurately reflect the real-world connections between ...