Cardinality in DBMS (original) (raw)

Last Updated : 14 Jan, 2026

In database management, cardinality represents the number of times an entity of an entity set participates in a relationship set. Or we can say that the cardinality of a relationship is the number of tuples (rows) in a relationship. It is a fundamental concept that helps define how data in different tables connect and how many unique entries exist in a particular column.

types_of_cardinality

**Mapping Cardinality

In a database, the mapping cardinality or cardinality ratio denotes the number of entities to which another entity can be linked through a certain relation set. Mapping cardinality is most useful in describing binary relation sets, although it can contribute to the description of relation sets containing more than two entity sets.

Types of cardinality in between tables are:

**One-to-One

In this type of cardinality mapping, an entity in A is connected to at most one entity in B. Or we can say that a unit or item in B is connected to at most one unit or item in A.

One to One

One to One

**Example:

In a particular hospital, the surgeon department has one head of department. They both serve one-to-one relationships.

ER Diagram

**One-to-Many

In this type of cardinality mapping, an entity in A is associated with any number of entities in B. Or we can say that one unit or item in B can be connected to at most one unit or item in A.

One to Many

One to Many

**Example:

In a particular hospital, the surgeon department has multiple doctors. They serve one-to-many relationships.

ER Diagram

**Many-to-One

In this type of cardinality mapping, an entity in A is connected to at most one entity in B. Or we can say a unit or item in B can be associated with any number (zero or more) of entities or items in A.

Many to One

Many to One

**Example:

In a particular hospital, multiple surgeries are done by a single surgeon. Such a type of relationship is known as a many-to-one relationship.

ER Diagram - Many to One

**Many-to-Many

In this type of cardinality mapping, an entity in A is associated with any number of entities in B, and an entity in B is associated with any number of entities in A.

Many to Many

**Example:

In a particular company, multiple people work on multiple projects. They serve many-to-many relationships.

ER Diagram - Many to Many

The appropriate mapping cardinality for a particular relation set obviously depends on the real-world situation in which the relation set is modeled.