What is cardinality in the context of Entity-Relationship Diagrams (ERDs)?
Cardinality is the mathematical sense just means the number of values in a set. In relationship to databases and ERD, cardinality specifies how many instances of an entity relate to one instance of another entity. Ordinality is also closely linked to cardinality.
In data modeling, cardinality is employed to describe the relationships between tables within a database. Understanding the cardinality between tables is pivotal in shaping the structure of a database and ensuring that the relationships between tables are accurately represented
Types of Cardinality
Different types of cardinality commonly used in ERDs
One-to-One (1:1) - One instance of an entity is related to only one instance of another entity.
One-to-Many (1) - One instance of an entity is related to many instances of another entity .
Many-to-Many (M) - Many instances of one entity can be related to many instances of another entity.