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.
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.
Every ER diagram, in any notation, is built from the same few ideas.
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.
A detail about an entity, such as a name or a price. Attributes become the columns of the table.
The attribute, or combination of attributes, that uniquely identifies each row. Usually an id.
A column that holds another table’s primary key. It is what actually creates the link between two tables.
How two entities connect, drawn as a line. “A customer places orders” is a relationship between customers and orders.
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.
Mandatory one
Every row on the far side relates to one and only one row here. Example: an order belongs to exactly one customer.
Optional one
A row may have a match, but never more than one. Example: an employee has at most one company car.
Mandatory many
At least one match is required, and there can be several. Example: an order contains one or more items.
Optional many
There can be none, one, or many matches. Example: a customer can have no orders yet, or hundreds.
| Symbol | Minimum | Maximum | Reads as |
|---|---|---|---|
| Two bars | 1 | 1 | exactly one |
| Circle and bar | 0 | 1 | zero or one |
| Bar and foot | 1 | many | one or many |
| Circle and foot | 0 | many | zero or many |
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.