Cardinality specifies the maximum number of instances of one entity that may be associated with an instance of another entity. Modality specifies the minimum number required, showing whether participation in the relationship is optional or mandatory.
In an entity-relationship diagram (ERD), these constraints are written at each end of a relationship. Together, they define the permitted minimum and maximum participation of an entity.
| Constraint | Meaning |
|---|---|
| Cardinality of one | At most one related entity instance |
| Cardinality of many | More than one related entity instance is permitted |
| Modality of zero | Participation is optional |
| Modality of one | Participation is mandatory |
Combining cardinality and modality produces four common constraints:
| Minimum and maximum | Interpretation |
|---|---|
0..1 | Zero or one: optional, with at most one instance |
1..1 | Exactly one: mandatory, with only one instance |
0..many | Zero or many: optional, with multiple instances permitted |
1..many | One or many: at least one instance is required |
For example, consider STUDENT and SUBMISSION. A student may make zero or many submissions, so the constraint at the SUBMISSION end is 0..many. Every submission must belong to exactly one student, so the constraint at the STUDENT end is 1..1.
In crow's foot notation, a circle represents zero, a vertical line represents one, and a crow's foot represents many. The symbols at an endpoint therefore communicate both modality and cardinality.
A common misconception is that cardinality alone states the complete relationship constraint. In precise database design, saying “one-to-many” gives the maximum participation but does not show whether either side is optional. Modality supplies that missing minimum.
For IB Computer Science topic A3.2 Database design, an exam response should identify the minimum and maximum participation at both ends of a relationship. When drawing an ERD, derive these constraints from the scenario's business rules rather than assuming every relationship is mandatory.