The cardinality is way to define the relationship between two relation in a data model :
Cardinalities further describe a join between 2 entity by stating how many rows in one relation will match rows in an another (It defines the minimum and maximum number of occurrences of one entity for a single occurrence of the related entity).
Cardinality is not a number; it is a range
The cardinality of one data table known as :
with respect to another data table known as :
define the type of relationships.
Left table cardinality | Right table cardinality | Type of relationship | ||
---|---|---|---|---|
Min | Max | Min | Max | |
1 | 1 | 1 | 1 | one-to-one |
0 | 1 | 1 | 1 | optional on one side one-to-one |
0 | n (or *) | 0 | n (or *) | optional on both sides many-to-many |
1 | 1 | 1 | n (or *) | one-to-many |
Cardinality | Min Instance | Max Instance | Graphic Notation |
---|---|---|---|
Exactly one | 1 | 1 | |
Zero or one | 0 | 1 | |
One or more | 1 | many (>1) | |
Zero, one, or more | 0 | many (>1) | |
More than one | >1 | >1 |