Reference · ER diagram symbols
ER diagram relationship symbols: lines, diamonds and what the arrows mean
In short
In an ER diagram a relationship is drawn as a line between two entities in crow's foot notation and as a diamond joined to the entities by lines in Chen notation. The line is labelled with a verb, carries cardinality marks at its ends, and is solid for an identifying relationship or dashed for a non-identifying one. A double diamond in Chen marks the identifying relationship of a weak entity. ER diagrams have no arrows of their own: an arrow on a line comes from UML or from older data structure diagrams.
Updated · by the ChartCraft team · drawings rendered with Mermaid 11.17.2 · part of the ER diagram symbols reference
What are the relationship symbols in an ER diagram?
Seven symbols cover every relationship you meet in a course: the plain line, the dashed line, the Chen diamond, the double diamond, the double line for total participation, the recursive loop and the associative entity.
| Symbol | Name | Notation | Meaning |
|---|---|---|---|
| Solid line | Crow's foot | A relationship. Solid means identifying: the child's key includes the parent's key. | |
| Dashed line | Crow's foot, IDEF1X | A non-identifying relationship: the child has its own key. | |
| Diamond | Chen | A relationship set, named with a verb, joined by lines to the entities that take part. | |
| Double diamond | Chen | The identifying relationship of a weak entity. | |
| Double line | Chen | Total participation: every instance of that entity takes part. | |
| Recursive line | All | A relationship between instances of the same entity, such as an employee managing employees. | |
| Three-way diamond | Chen | A ternary relationship among three entities. |
The marks at the ends of a line (bar, circle, crow's foot) are cardinality symbols. They have their own page: ER diagram cardinality symbols.
What do the solid and dashed line symbols mean?
Both are relationships. The difference is in the keys. On a solid line the child's primary key contains the parent's key, so the child cannot be identified without the parent. On a dashed line the child has its own key and the parent's key is only a foreign key.
| Drawing | Say it like this |
|---|---|
| A room is identified by its building and its number. The line is solid: identifying. | |
| An order has its own order number and only refers to its customer. The line is dashed: non-identifying. |
Mermaid draws a solid line with two hyphens (--) and a dashed line with two dots (..). Many tools and textbooks draw every relationship solid and ignore the difference, so follow your course.
How are recursive and many to many relationships drawn?
A recursive relationship is a line that starts and ends at the same entity. A many to many relationship has a crow's foot at both ends; in a logical model you replace it with an associative entity that holds the attributes of the pair.
| Drawing | Say it like this |
|---|---|
| Each employee manages zero or many employees. Each employee is managed by zero or one employee. | |
| Each student takes zero or many courses. Each course is taken by zero or many students. | |
| Each student has zero or many enrolments, each course has zero or many enrolments, and each enrolment links one student to one course. |
What do arrows mean in an ER diagram?
Crow's foot and Chen notation do not use arrowheads on relationship lines. If you see an arrow on an ERD, it comes from one of three places, and each means something different.
| Where the arrow comes from | What it means |
|---|---|
| UML class diagram | Navigability: the class at the tail can reach the class at the head. It says nothing about how many. |
| Chen 1976, weak entities | Chen's paper draws an arrow toward the weak entity DEPENDENT to show that it depends on EMPLOYEE for its identity. |
| Data structure (Bachman) diagrams | An arrow from the one record type to the many record type. Chen's paper discusses these arrows as a weaker form of 1:n relationship. |
classDiagram
direction LR
class Order
class Customer
Order --> Customer : placedByIf a question asks for an ER diagram in crow's foot or Chen notation, do not add arrowheads. Show direction by the verb you write on the line instead.
How do you draw the relationships of a university model?
Take a university: students, courses, departments and staff. Draw it in three steps, one kind of relationship at a time.
Step 1
Find the verbs
Underline the verbs in the scenario: a student takes courses, a department offers courses, an employee manages employees. Each verb is one relationship, and its subject and object are the entities.
Step 2
Resolve the many to many
Takes is many to many, and the grade belongs to the pair, not to the student or the course. Replace the line with an ENROLMENT entity.
erDiagram
direction LR
STUDENT ||--o{ ENROLMENT : has
ENROLMENT }o--|| COURSE : "is for"
ENROLMENT {
date enrolled_on
string grade
}Step 3
Add the recursive line
Manages joins EMPLOYEE to itself. The managed-by end is zero or one, because the head of the university has no manager.
erDiagram
EMPLOYEE |o--o{ EMPLOYEE : managesDraw this in the editor → Opens ChartCraft with this description filled in: “ER diagram for a university: students and courses are many to many through an enrolment entity holding the grade, a department has one or many courses, and an employee manages zero or many employees.”
Which relationship mistakes lose marks?
Three mistakes are about the relationship symbol itself, not the cardinality at its ends.
1. An arrow drawn on a crow's foot line
Loses marks
Correct
CUSTOMER ||--o{ ORDER : places
An arrowhead is UML navigability. In crow's foot notation the direction is carried by the verb and the cardinality by the marks.
2. No verb on the line
Loses marks
Correct
CUSTOMER ||--o{ ORDER : places
A relationship is named by a verb so that it reads as a sentence. In Chen notation the verb goes inside the diamond.
3. A Chen diamond drawn between crow's foot marks
Loses marks
Diamond and crow's foot together
Correct
Crow's foot only
Use one notation. Diamonds belong to Chen notation, end marks to crow's foot.
Can you answer these five relationship questions?
One question per idea on the page. Answer, then open the worked answer.
Question 1. A ROOM's primary key is (building_id, room_no). Is the BUILDING to ROOM line solid or dashed?
Worked answer
Solid. The room's key contains building_id, so the relationship is identifying.
Question 2. How do you draw a relationship where a person is married to another person?
Worked answer
As a recursive relationship: one line from PERSON back to PERSON, labelled married to, with zero or one at both ends.
Question 3. Students and clubs are many to many, and the date each student joined a club must be stored. Where does the date go?
Worked answer
In an associative entity such as MEMBERSHIP between STUDENT and CLUB. The date belongs to the pair, so it cannot sit in either entity.
Question 4. What is a double diamond in Chen notation?
Worked answer
The identifying relationship of a weak entity, the relationship through which the weak entity gets the key of its owner.
Question 5. Your teacher's ERD shows an arrow from ORDER to CUSTOMER. What is the most likely meaning?
Worked answer
It is borrowed from UML or data structure diagrams. In UML it means an order can navigate to its customer. Ask which notation the course uses, and do not read it as cardinality.
Questions
What are the ER diagram relationship symbols?
A line (crow's foot) or a diamond (Chen) between entities, labelled with a verb. Solid and dashed lines, double diamonds and double lines add identifying and participation detail.
What do the arrows mean in an ERD?
ER notations do not use arrowheads. An arrow on an ERD comes from UML, where it means navigability, or from older data structure diagrams, where it points from the one to the many record type.
What are ERD line symbols?
A solid line for an identifying relationship and a dashed line for a non-identifying one. The marks at the line ends are cardinality symbols.
What does a diamond mean in an ER diagram?
A relationship in Chen notation. The verb is written inside, and lines join it to each entity that takes part.
How is a many to many relationship shown?
With a crow's foot at both ends of the line, or M and N on a Chen diamond. In a logical model it is replaced by an associative entity.
What is a recursive relationship in an ER diagram?
A relationship between instances of one entity, drawn as a line that leaves the entity and comes back to it, such as an employee managing employees.
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.
- 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.
- 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.
- 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.