ErdDocs

ER diagram symbols

ER diagrams use three families of symbols: crow’s foot (the notation database tools draw), Chen (the one textbooks teach) and UML (class diagrams borrowed for data). In all three, a table or entity is a box and a relationship is a line between boxes; what differs is how each notation writes cardinality — how many rows on one side a row on the other side can have. Crow’s foot spells it with marks on the line ends (a bar for one, a circle for zero, a three-pronged foot for many), and every line is read twice, once toward each table. Every symbol below is shown with its reading, drawn by ErdDocs in the same notation it puts on your own schema in the tool below.

What do the crow’s foot line-end symbols mean?

Everything in crow’s foot happens at the ends of the line. Each end stacks up to two marks, and the one closest to the table is the maximum; the outer one is the minimum:

SymbolNameHow it readsExample
Exactly one line endExactly oneExactly one is bar + bar: at least one, at most onean order belongs to exactly one customer
Zero or one line endZero or oneZero or one is circle + bar: optional, at most onea customer has at most one loyalty card
One or many line endOne or manyOne or many is bar + crow’s foot: at least onean order contains at least one line item
Zero or many line endZero or manyZero or many is circle + crow’s foot: any number, including nonea customer has zero or many orders
Crow’s foot notation cheat sheet: the four line-end symbols — exactly one (bar and bar), zero or one (circle and bar), one or many (bar and crow’s foot), zero or many (circle and crow’s foot)Crow’s foot notation cheat sheet: the four line-end symbols — exactly one (bar and bar), zero or one (circle and bar), one or many (bar and crow’s foot), zero or many (circle and crow’s foot)
The same four ends as one card — save it, or download the SVG in light or dark.

Reading a whole line

A relationship line is read twice, once toward each table. The classic shop example:

customers to orders: one customer, zero or many orderscustomersorders
Toward orders: a customer has zero or many orders. Toward customers: an order belongs to exactly one customer.

The full reading rules — and what the marks mean when a schema is only half-known — are on the crow’s foot notation page; which combination to pick is a question of cardinality.

Chen vs crow’s foot vs UML

ConceptChenCrow’s footUML
Entity / tableRectangleBox with the column list insideClass box
AttributeOval linked to the entityA row inside the table boxA field in the class box
RelationshipDiamond between entitiesA line with cardinality marks at each endAssociation line
Cardinality1, N, M letters near the diamondBar, circle and crow’s foot marks on the line ends1, 0..1, 1..*, * multiplicities
Primary keyUnderlined attribute nameKey marker on the column rowStereotype or property string

Rule of thumb: Chen while the schema is an idea, UML when the diagram lives next to application code, and crow’s foot once it is a database — the case ErdDocs draws, straight from the schema you paste.

One symbol the textbooks skip: the dashed line

Real dumps are often missing their foreign keys — Rails, Django and Laravel apps frequently enforce relationships in application code, so the database declares nothing. ErdDocs adds a symbol for that case instead of drawing nothing: a solid line is a relationship the database declares, a dashed line is one matched from column names (user_id → users). The distinction matters: one is a constraint, the other is a well-founded guess.

a dashed line: relation inferred from column names, not declaredusersposts
Dashed: no FOREIGN KEY in the dump — the line comes from the naming convention.

See the symbols on a real schema

The fastest way to learn the symbols is to watch them appear from DDL you understand. Below, ErdDocs generates the diagram from the shop schema: the maximum mark sits at each end — the crow’s foot for many, a bar for one — and the full cardinality is named on a plate when you select a line. Paste your own pg_dump --schema-only or Prisma schema to see yours; parsing runs in your browser.

Your schema

FAQ

What do the crow’s foot symbols mean?

Each line end stacks up to two marks. The mark closest to the table is the maximum: a bar means “at most one”, the three-pronged crow’s foot means “many”. The outer mark is the minimum: a bar means “at least one”, a circle means “zero is allowed”. So circle + crow’s foot reads “zero or many”, bar + bar reads “exactly one”.

Which notation should I use — Chen or crow’s foot?

Chen for teaching and conceptual modeling: its diamonds make relationships first-class, which is what a lecture needs. Crow’s foot for real databases: one box per table with its columns inside, which is what a schema actually looks like. Nearly every database tool draws crow’s foot, ErdDocs included — paste a dump, a Prisma schema or framework migrations and it marks the many end of every line from the foreign keys and unique constraints it finds.

What is the symbol for a many-to-many relationship?

A crow’s foot on both ends of the line. In a physical schema the many-to-many is implemented through a junction table (order_items between orders and products), so ErdDocs and other tools that draw real databases show two one-to-many lines meeting at the junction table instead of a single many-to-many line — including the junction tables Prisma and TypeORM generate for you.

Why do database tools not draw Chen diamonds and ovals?

Because in a physical database the things Chen draws separately collapse into tables and columns: an attribute oval is a row inside the table box, and a relationship diamond is either a foreign key column or a junction table. Drawing them as separate shapes would double the diagram’s size without adding a fact.

Related