Crowsfoot

ER diagram notation: crow’s foot symbols explained

An entity relationship (ER) diagram is a map of your data: the things you store, the details you keep about them, and how they connect. This guide explains what each part means and how to read the crow’s foot symbols.

What an ER diagram is made of

Every ER diagram, in any notation, is built from the same few ideas.

Entity

A thing you keep data about, such as a customer or an order. In a database, an entity usually becomes a table, drawn as a box.

Attribute

A detail about an entity, such as a name or a price. Attributes become the columns of the table.

Primary key (PK)

The attribute, or combination of attributes, that uniquely identifies each row. Usually an id.

Foreign key (FK)

A column that holds another table’s primary key. It is what actually creates the link between two tables.

Relationship

How two entities connect, drawn as a line. “A customer places orders” is a relationship between customers and orders.

Crow’s foot symbols

Crow’s foot notation gets its name from the three-pronged symbol that means “many”, which looks like a bird’s foot. Each end of a relationship line carries a symbol that says how many rows can sit on that side.

The symbols combine two ideas. Cardinality is the maximum: one or many. Modality, also called optionality, is the minimum: zero (the relationship is optional) or one (it is required). A small circle means zero, a bar means one, and the foot means many.

Exactly one

Mandatory one

Every row on the far side relates to one and only one row here. Example: an order belongs to exactly one customer.

Zero or one

Optional one

A row may have a match, but never more than one. Example: an employee has at most one company car.

One or many

Mandatory many

At least one match is required, and there can be several. Example: an order contains one or more items.

Zero or many

Optional many

There can be none, one, or many matches. Example: a customer can have no orders yet, or hundreds.

SymbolMinimumMaximumReads as
Two bars11exactly one
Circle and bar01zero or one
Bar and foot1manyone or many
Circle and foot0manyzero or many

The three relationship types

One-to-one (1:1)

One row on each side matches at most one row on the other. Profiles are a classic example: each user has at most one profile. The giveaway is that the foreign key is also the primary key of its table.

users PK id bigint email varchar profiles PK user_id bigint bio text avatar_url varchar

One-to-many (1:N)

One row on one side can match many rows on the other. This is the most common relationship. One customer places many orders, but each order belongs to one customer. The foreign key lives on the “many” side.

customers PK id bigint name varchar orders PK id bigint FK customer_id bigint total numeric

Many-to-many (N:N)

Rows on both sides can match many on the other. A student takes many courses, and a course has many students. Databases can’t store this directly, so you add a junction table with a foreign key to each side. The result is two one-to-many relationships.

students PK id bigint name varchar courses PK id bigint title varchar enrollments PK student_id bigint PK course_id bigint

How to read a line

  1. Pick one table and follow the line to the other table.
  2. Look at the symbol at the far end. It tells you how many rows of that table relate to one row of the table you started at.
  3. Say it out loud: “One customer can have zero or many orders.” Then do the same from the other end: “One order belongs to exactly one customer.”

If both sentences make sense for your business, the diagram is right. If one doesn’t (for example, an order with no customer), fix the symbol or the design.

How Crowsfoot draws these

In the Crowsfoot editor, a relationship line shows a single bar on the “one” end and a crow’s foot on the “many” end. Click any line to choose one-to-many, one-to-one, or many-to-many, and use Swap sides if the line is the wrong way round.

Optional versus required isn’t drawn with a circle yet. You can still record it: on a foreign key column, the N toggle in the table panel marks it as nullable (optional) or required, and that flows into the SQL you export.

The fastest way to learn is to look at a finished diagram. Pick one from the example schemas, open it in the editor, and click the lines.

Questions

What does the crow’s foot mean in an ER diagram?

The three-pronged end of a line means “many”. It shows that one row on the other side of the line can be related to many rows in that table.

What is cardinality?

Cardinality is the maximum number of rows that can relate: one or many. Its partner, modality or optionality, is the minimum: zero (optional) or one (required).

What is the difference between a primary key and a foreign key?

A primary key uniquely identifies each row in its own table. A foreign key is a column that stores another table’s primary key value, and it is what creates the relationship.

How do you show a many-to-many relationship?

Add a junction table (also called a link or join table) between the two tables. It holds a foreign key to each side, so each many-to-many relationship becomes two one-to-many relationships.

Are there other ER diagram notations?

Yes. Chen notation draws entities as rectangles, attributes as ovals, and relationships as diamonds. UML class diagrams and IDEF1X are other styles. Crow’s foot is popular for database design because it is compact and maps directly to tables and columns.