Cardinality in Entity-Relationship Diagrams

Cardinality in Entity-Relationship Diagrams

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.

ER Diagram Example

https://lucid.app/lucidchart/c8b280ab-56bf-4d81-8bba-40f119912048/edit?viewport_loc=-645%2C-605%2C2478%2C1216%2C0_0&invitationId=inv_3e3478a2-7289-481a-882c-b95914d5ffd0