Reference · ER diagram symbols
ER diagram cardinality symbols: what each line end means
In short
ERD cardinality symbols are the marks at each end of a relationship line. In crow's foot notation there are four: two bars mean exactly one, a circle and a bar mean zero or one, a bar and a crow's foot mean one or many, and a circle and a crow's foot mean zero or many. Every end is made of two marks: the one nearest the entity box is the maximum, the one further out is the minimum. Chen notation writes 1, N and M on the lines instead, and UML writes multiplicities such as 1 and 0..*.
Updated · by the ChartCraft team · drawings rendered with Mermaid 11.17.2 · part of the ER diagram symbols reference
What are the cardinality symbols in an ER diagram?
There are four cardinality symbols in crow's foot notation, and each is a pair of marks at the end of a relationship line. Learn the three marks first (bar, circle, crow's foot), then the four pairs they make.
| Symbol | Name | Minimum | Maximum | Mermaid | Example from a school timetable |
|---|---|---|---|---|---|
| Exactly one | 1 | 1 | || | LESSON }o--|| ROOM : "takes place in": each lesson takes place in exactly one room | |
| Zero or one | 0 | 1 | o| or |o | TEACHER ||--o| FORM_GROUP : tutors: a teacher tutors at most one form group, and may tutor none | |
| One or many | 1 | Many | |{ or }| | FORM_GROUP ||--|{ LESSON : attends: every form group attends at least one lesson | |
| Zero or many | 0 | Many | o{ or }o | TEACHER ||--o{ LESSON : teaches: a new teacher may have no lessons yet |
Mermaid writes the pair the way it is drawn on that side of the line, so the zero or many end is o{ on the right of the two hyphens and }o on the left. Both mean the same thing.
erDiagram
TEACHER ||--o{ LESSON : teaches
ROOM ||--o{ LESSON : hosts
FORM_GROUP ||--|{ LESSON : attends
TEACHER ||--o| FORM_GROUP : tutors
How do you tell the minimum from the maximum?
The mark nearest the entity box is the maximum and the mark further from the box is the minimum. A circle can only be a minimum (zero), a crow's foot can only be a maximum (many), and a bar can be either, which is why exactly one has two bars.
| Mark | As the inner mark (maximum) | As the outer mark (minimum) |
|---|---|---|
| At most one | At least one: the relationship is mandatory | |
| Never used here | Zero: the relationship is optional | |
| Many | Never used here |
Some textbooks call the maximum the cardinality and the minimum the modality or ordinality. The marks are the same whichever word your course uses.
How do you read cardinality symbols out loud?
Start at one entity, go along the line, and read the two marks at the far end as "zero or one", "exactly one", "one or many" or "zero or many". Then go back the other way. Every line gives two sentences.
| Drawing | Say it like this |
|---|---|
| Each lesson takes place in exactly one room. Each room hosts zero or many lessons. | |
| Each teacher tutors zero or one form group. Each form group is tutored by exactly one teacher. | |
| Each form group attends one or many lessons. Each lesson is attended by exactly one form group. | |
| Each teacher teaches zero or many lessons. Each lesson is taught by exactly one teacher. |
How do you choose the right cardinality, step by step?
Ask four questions for every line: the minimum and maximum in one direction, then the minimum and maximum in the other. Here is the school timetable worked through in three steps.
Step 1
Ask the maximum questions
Can a teacher teach many lessons? Yes. Can a lesson have many teachers? In this school, no. So the LESSON end gets a crow's foot and the TEACHER end gets a bar as its inner mark.
Step 2
Ask the minimum questions
Can a teacher exist with no lessons, for example a teacher who has just joined? Yes, so the LESSON end gets a circle. Can a lesson exist with no teacher? No, so the TEACHER end gets a second bar.
erDiagram
direction LR
TEACHER ||--o{ LESSON : teachesStep 3
Repeat for every line
Do the same for ROOM, FORM_GROUP and the tutor relationship. A form group always has lessons (one or many), and a teacher tutors at most one group and may tutor none (zero or one).
erDiagram
TEACHER ||--o{ LESSON : teaches
ROOM ||--o{ LESSON : hosts
FORM_GROUP ||--|{ LESSON : attends
TEACHER ||--o| FORM_GROUP : tutorsDraw this in the editor → Opens ChartCraft with this description filled in: “ER diagram for a school timetable: a teacher teaches zero or many lessons, a room hosts zero or many lessons, a form group attends one or many lessons, and a teacher tutors zero or one form group.”
How is cardinality written in Chen, UML and (min,max) notation?
The meaning is the same in every notation; only the marks change. Chen writes the maximum as 1, N or M on the lines into the diamond. UML writes lower..upper at each end. The (min,max) style writes a pair next to each entity.
| Meaning at the B end | Crow's foot | Chen | UML | (min,max) at A |
|---|---|---|---|---|
| Exactly one | 1 (with a double line for total participation) | 1 | (1,1) | |
| Zero or one | 1 | 0..1 | (0,1) | |
| One or many | N (with a double line for total participation) | 1..* | (1,N) | |
| Zero or many | N | 0..* or * | (0,N) |
Chen's 1976 paper shows only the maximum (1, m, n). Minimums in Chen diagrams come from later textbook extensions, most often a double line for total participation or a (min,max) pair, so check which one your course uses. The (min,max) pair is written next to the entity it counts, which puts it at the opposite end from the crow's foot mark with the same meaning.
classDiagram
direction LR
class Teacher
class Lesson
Teacher "1" -- "0..*" Lesson : teaches
Which cardinality mistakes lose marks?
Most marks are lost on minimums, not maximums. Students usually get the crow's foot in the right place and then put a bar where the scenario needs a circle.
1. A mandatory minimum where the scenario allows zero
Loses marks
CUSTOMER ||--|{ ORDER : places
Correct
CUSTOMER ||--o{ ORDER : places
A bar and a crow's foot at ORDER say every customer has at least one order, so a customer could not register before buying. Read the question for words like may, can or not yet: they mean a circle.
2. The marks are read from the wrong side
Loses marks
Crow's foot next to TEACHER
Correct
Crow's foot next to LESSON
The marks next to LESSON answer: how many lessons does one teacher have? Writing the answer next to the entity you started from swaps the meaning.
3. Inner and outer marks are swapped
Loses marks
Circle next to the box, crow's foot outside
Correct
Crow's foot next to the box, circle outside
The crow's foot is a maximum and always touches the box. A circle next to the box would mean a maximum of zero, which is not a relationship at all.
Is there a printable ER cardinality cheat sheet?
Yes. The sheet below has the four line ends, the three marks, and the same cardinality in Chen, UML, (min,max) and IDEF1X on one page.
Can you answer these five cardinality questions?
Each question uses one rule from this page. Try it before you open the worked answer.
Question 1. Which mark can only be a minimum, and which can only be a maximum?
Worked answer
The circle is only ever a minimum (zero), so it is always the outer mark. The crow's foot is only ever a maximum (many), so it always touches the box.
The bar can be either, which is why exactly one is drawn with two bars.
Question 2. What does PASSPORT |o--|| PERSON : identifies say?
Worked answer
From PASSPORT, the far end shows two bars: each passport identifies exactly one person.
From PERSON, the far end shows a circle and a bar: each person has zero or one passport.
Question 3. A hospital ward always has at least one bed and can have many. Which symbol goes at the BED end?
Worked answer
Minimum one, maximum many: one or many, a bar and a crow's foot. In Mermaid: WARD ||--|{ BED : contains.
Question 4. Write zero or many in UML and in a (min,max) pair.
Worked answer
UML writes 0..*, or just *, at the many end (UML 2.5.1 clause 7.5.4).
The (min,max) pair is (0,N), written next to the entity that takes part zero to N times.
Question 5. A student says "a circle means many". Where does that confusion come from, and what is right?
Worked answer
The circle sits right next to the crow's foot in the common zero or many end, so it gets read as part of the many mark.
The circle means zero. It sets the minimum. The crow's foot alone means many.
Questions
What are the ERD cardinality symbols?
In crow's foot notation there are four: two bars (exactly one), a circle and a bar (zero or one), a bar and a crow's foot (one or many), and a circle and a crow's foot (zero or many).
What are the cardinality symbols in an ER diagram?
They are the marks at each end of a relationship line that say how many instances of the entity at that end can relate to one instance of the entity at the other end.
In an ERD, how is cardinality represented at the ends of connectors?
Using symbols such as a bar, a circle and a crow's foot. The mark nearest the entity is the maximum and the mark further out is the minimum.
What does a circle mean in an ER diagram?
Zero. It is the minimum, so the relationship is optional on that side. A circle and a crow's foot together mean zero or many.
What does a double bar mean in an ERD?
Exactly one: a minimum of one and a maximum of one. It is also called one and only one, or mandatory one.
How is cardinality shown in Chen notation?
By writing 1, N or M on the lines between the entity rectangles and the relationship diamond. Textbooks add a double line or a (min,max) pair to show the minimum.
What is the difference between cardinality and modality?
Cardinality is the maximum number of related instances (one or many). Modality, also called ordinality or optionality, is the minimum (zero or one).
Sources
The rules and names on this page were checked against these documents.
- Mermaid documentation, Entity Relationship Diagrams. The four mark pairs (|o, ||, }o, }|), the word aliases, identifying (--) and non-identifying (..) lines, and the PK, FK and UK keys.
- A Practical Introduction to Databases, chapter 2.4, ERD alternatives and variations. Open textbook on Runestone Academy. Source for the reading rule of crow's foot marks (the symbol closest to the entity is the maximum, the one further away the minimum) and for the (min,max) and 0..N alternatives.
- Peter Pin-Shan Chen, The Entity-Relationship Model: Toward a Unified View of Data (1976). The MIT Sloan working paper of the article published in ACM Transactions on Database Systems 1(1). Section 3.1: entity sets as rectangular boxes, relationship sets as diamond-shaped boxes, and 1, m and n written in the diagram.
- OMG Unified Modeling Language, version 2.5.1. Clause 7.5.4 for multiplicity strings (lower..upper, * for an unlimited upper bound, * alone for 0..*) and clause 11.5.4 for association notation.
- FIPS PUB 184, Integration Definition for Information Modeling (IDEF1X). Clause 3.5.2: a line with a dot at the child end, P for one or more, Z for zero or one, a solid line for an identifying and a dashed line for a non-identifying relationship.