Mapping constraints (also called cardinality ratios) express the number of entities to which another entity can be associated via a relationship set. They define the structural bounds of relationships in an ER model.

Types of Mapping Constraints
Mapping constraints define how many entities of one entity set can be associated with entities of another entity set through a relationship. They help us understand the number of relationships that are possible between two entities.
There are four main types of mapping constraints:
1. One-to-One (1:1)
In a One-to-One (1:1) relationship, one entity in Set A can be associated with at most one entity in Set B, and one entity in Set B can also be associated with at most one entity in Set A. In simple words, one entity is related to only one entity on the other side.
Example: A Department has only one Head of Department (HOD), and a professor can be the HOD of only one department.
Visual:[ Department ] --- (1) --- < HAS_HOD > --- (1) --- [ Professor ]
2. One-to-Many (1)
In a One-to-Many (1) relationship, one entity in Set A can be associated with many entities in Set B. However, each entity in Set B can be associated with at most one entity in Set A. In simple words, one entity can be related to many entities, but each of those entities is related to only one entity on the other side.
Example: One Department can employ many Employees, but each employee belongs to only one department.
Visual:[ Department ] --- (1) --- < EMPLOYS > --- (N) --- [ Employee ]
3. Many-to-One (N:1)
In a Many-to-One (N:1) relationship, many entities in Set A can be associated with at most one entity in Set B. At the same time, one entity in Set B can be associated with many entities in Set A. In simple words, many entities are related to one entity.
Example: Many Students can study in one College, while each student is associated with one college.
Visual:[ Student ] --- (N) --- < STUDIES_IN > --- (1) --- [ College ]
Note: Many-to-One is the reverse direction of a One-to-Many relationship.
4. Many-to-Many (M)
In a Many-to-Many (M) relationship, an entity in Set A can be associated with many entities in Set B, and an entity in Set B can also be associated with many entities in Set A. In simple words, many entities on one side can be related to many entities on the other side.
Example: A Student can enroll in multiple Courses, and each course can have multiple students enrolled in it.
Visual:[ Student ] --- (M) --- < ENROLLS > --- (N) --- [ Course ]
Easy Way to Remember
| Type | Simple Meaning | Example |
|---|---|---|
| 1:1 | One → One | Department → HOD |
| 1 | One → Many | Department → Employees |
| N:1 | Many → One | Students → College |
| M | Many → Many | Students → Courses |