Multiplicity

Multiplicity defines how many instances of one entity can be associated with instances of another in a relationship. It is specified as a range lower..upper on each end of an association in UML class diagrams and ERDs.

Notation

NotationMeaningExample
1Exactly oneAn order has exactly 1 customer
0..1Zero or one (optional)An employee has 0 or 1 parking spots
* or 0..*Zero or moreA customer has 0 or more orders
1..*One or moreAn order has at least 1 line item
n..mBetween n and mA team has 2..5 members

Reading Multiplicities

From one class, look at the opposite end: “One instance of Class A is associated with [multiplicity at B’s end] instances of Class B.”

Relationship Types from Multiplicity

MultiplicityRelationship TypeImplementation
11One-to-OneForeign Key with UNIQUE on either table
1*One-to-ManyForeign Key on the “many” side
**Many-to-ManyJunction Table with two FKs