5.3 Cardinality

The cardinality denotes how many connected entities of two tables relate to each other. More accurately, the cardinality represents the upper bounds, that is the maximum number of related entities. The following cardinalities exist:

  • One-to-one
  • One-to-many
  • Many-to-many

One-to-one means, that basically a maximum of one entity relates to one other entity: a car has one engine. One-to-many means, one entity opposes many other entities: a customer can have several addresses. Many-to-many means, that a mutual one-to-many relationship exists: a team has many players, but a player can also be a part of several teams (e.g. youth players). The following image shows the three basic cardinalities, applied to a binary referential relationships:

Cardinalities (Chen Notation)
Cardinalities (Chen Notation)

The cardinality property can be confusing. Many sources use different levels at which cardinalities are used. The cardinality only applies "per edge". This is, because the cardinalities, like edges, have only two properties: the source and the destination. In some sources, the cardinality is used for the whole relationship. This is inaccurate. It's true for relationships with of a degree of two. Higher-degree (many-to-many) relationships must specify the cardinality per edge.

For hierarchical relationships, the degree is usually greater than two, because there are usually two or more sub entity types involved. If you have only one sub entity type, consider merging the super and sub entity types into one. For hierarchical relationships, the cardinality is always one-to-one. While some sources also mention one-to-many cardinalities for hierarchical relationships, I've never come up with any such examples. Maybe they're wrong.

In modeling, cardinalities may be restricted to concrete numbers, like two, three, or even odd and even numbers. Example: while one-to-many generally applies, a basketball game can only have a maximum of two competing teams, up to three referees, or four plus periods (overtimes omitted). Note again, that the cardinality itself represents only the upper bound of that relationship. The optionality property up next defines the lower bounds.

Last updated: 2010-10-13