ER Diagrams   «Prev  Next»

Lesson 7One-to-many Relationships
Objective Identify one-to-many relationships.

Identify One-to-many Relationships

How does a data designer identify "One-to-many" Relationships in an ERD model?
A data designer identifies **one-to-many (1\:M)** relationships in an **Entity-Relationship Diagram (ERD)** using both **cardinality notation** and **semantic understanding** of the domain. Here's a step-by-step breakdown:
### ✅ **1. Look for Entities with Foreign Key Dependency** * One entity (the **“many” side**) contains a **foreign key** that references the **primary key** of another entity (the **“one” side**). **Example:** * `CUSTOMER (CustomerID)` → **one** * `ORDER (OrderID, CustomerID)` → **many** --- ### ✅ **2. Interpret the Real-World Relationship** Ask: "**Can one \[Entity A] be associated with many \[Entity B]?**" Examples:**
This real-world logic is the foundation of the 1\:M relationship. --- ✅ **3. Observe Crow’s Foot Notation (if used)**
In **Crow’s Foot notation**:
  • The **"one" side** has a straight line ─
  • The **"many" side** has a **crow’s foot** (three prongs)

ERD Symbol Example:**
EMPLOYEE ─────< DEPARTMENT
(one)       (many)
--- ✅ **4. Check for Optionality**
  • A small circle (◯) means **optional**.
  • A straight line (|) means **mandatory**.

Example: `CUSTOMER ──|────< ORDER` Means:
  • One customer can have many orders.
  • Each order **must** have one customer.

✅ **5. Verify Cardinality/Multiplicity Labels**
Some ERDs use numeric labels:
CUSTOMER (1)  ───<────  (0..*) ORDER
  • 1 customer can be linked to 0 or many orders.
  • Each order is linked to exactly 1 customer.

Summary Table
Indicator Meaning
Foreign Key FK on many-side referencing PK on one-side
Crow's Foot Three prongs on many-side
Cardinality 1 to 0..*, or 1 to N
Domain Logic One entity logically contains/controls many of another
325
1-to-many ERD diagram outlining 1 toy department having many different types of stuffed animals.

Most Databases are comprised entirely of one-to-many Relationships

Because one-to-one relationships are rare and because all many-to-many relationships must be converted into one-to-many relationships (you will find out why later on in this module), most databases are comprised entirely of one-to-many relationships. A typical business rule for a 1:N relationship might be stated as follows:
Each employee is assigned to one department; each department has many employees.

  1. The two entities represented in the example above are EMPLOYEE and DEPARTMENT.
  2. The EMPLOYEE:DEPARTMENT relationship is 1:1; for DEPARTMENT:EMPLOYEE the relationship is 1:N.
  3. The “N” in 1:N represents either a value greater than one or an unlimited value.
  4. One-to-many relationships are fairly easy to identify.
Consider the examples illustrated in the following series of images:

1) Customer may place many orders (1:N)
1) Customer may place many orders (1:N)

2) and each order comes from a single customer
2) and each order comes from a single customer.

3) Every project is assigned to a project manager
3) Every project is assigned to a project manager

4) But a project manager may be assigned to no more than three projects (1:N)
4) But a project manager may be assigned to no more than three projects (1:N)

5) A vendor supplies many products (1:N)
5) A vendor supplies many products (1:N)

6) but each product comes from a single vendor.
6) but each product comes from a single vendor.

Identify Relationships between Database Tables

In an Entity-Relationship Diagram (ERD), a one-to-many relationship is identified when one entity instance is associated with multiple instances of another entity. This is also referred to as a "1:N" relationship. For example, consider a bookstore database. The "Book" entity might have a one-to-many relationship with the "Author" entity because one book can have multiple authors, but each author can only be associated with one book. In this case, the "Book" entity would be the "one" side of the relationship, and the "Author" entity would be the "many" side of the relationship.
To represent this relationship in an ERD, you would draw a line between the two entities and place a crow's foot symbol (an open triangle) on the "many" side of the line. The "one" side of the relationship does not require any special notation. It's important to identify one-to-many relationships in an ERD because they help to ensure that the database is properly designed and organized. By understanding the relationships between entities, developers can better define data relationships and design more effective and efficient database structures.
Entity-relationship (ER) diagrams (ERDs) provide a way to document the entities in a database along with the attributes that describe them. There are actually several styles of ER diagrams. Today there are three major methods:
  1. the Chen model (named after the originator of ER modeling, Dr. Peter P.S. Chen),
  2. Information Engineering (IE, or crows feet), and
  3. Unified Modeling Language (UML).
If you are not including object-oriented concepts in a data model, it really does not matter which you use, as long as everyone who is using the diagram understands the symbols. However, UML is specifically intended for the object-oriented environment and is usually the choice when objects are included.

many-to-one (N:1) Relationship

A many-to-one (N:1) relationship is a mirror image of a one-to-many (1:N) relationship. They are treated identically. Once a 1:N relationship has been identified, it is a snap to create a link between two entities: the entity (table) on the “many” side of the relationship receives the key attribute (primary key) from the entity (table) on the “one” side of the relationship. The graphic below illustrates the link between the EMPLOYEE and DEPARTMENT entities:

Link between EMPLOYEE and DEPARTMENT entities
Link between EMPLOYEE and DEPARTMENT entities.
The entity on the 'many' side of the relationship receives the key attribute (primary key) from the entity on the 'one' side of the relationship.

The next lesson defines many-to-many relationships.

One To Many Relationships - Exercise

Before moving on to the next lesson, click the Exercise link below to check your understanding of one-to-many relationships.
One To Many Relationships - Exercise

SEMrush Software