Skip to content
flowchart.tools

ER diagram tool

Tables you edit as text, relationship lines in crow's foot notation, and a one-paste import from CREATE TABLE statements.

E-commerce database ER diagram template. About this example

ER diagram symbols

Most teams draw tables with crow's foot lines. The Chen notation shapes, used in database courses, are included as well.

SymbolNameMeaning
Table (entity)The name on top, then one column per line: name, type, and PK or FK. Primary keys are shown in bold.
Entity (Chen)A thing you store data about.
Attribute (Chen)A property of an entity.
Relationship (Chen)How two entities are related, named with a verb.

Crow's foot notation

Each end of a relationship line says how many rows on that side can relate to one row on the other. Read the symbol nearest a table as "how many of these".

LineNameMeaning
One to manyOne row on the left relates to one or more on the right. A customer has one or more addresses.
One to zero or manyThe many side is optional. A customer has zero or more orders. This is what a nullable-free foreign key gives you.
One to oneExactly one on each side. A user has one profile.
One to zero or oneThe right side is optional. An order has at most one refund.
Many to manyMany on both sides. In a real schema this becomes a join table with two one-to-many lines.

How to draw one

  1. Paste your schema into the SQL to ER diagram tool, or open the editor with the ER shapes and add a table.

  2. Double-click a table to edit it: the name on the first line, then one column per line with its type.

  3. Connect two tables, select the line and choose the relationship, such as one to many.

  4. Drag tables to group them by domain, then export for your documentation.

Open the editor

Start from the schema you already have

If the database exists, do not redraw it. Paste the output of pg_dump --schema-only or mysqldump --no-data into the SQL to ER diagram tool. It reads tables, columns, primary keys and foreign keys, draws every relationship with crow's feet, and opens in the editor for rearranging.

Tables are text

A table is one shape. Editing it is editing a few lines of text, so adding a column is typing a line and renaming a table is changing the first one. The box resizes to fit.

Reading cardinality

Two marks sit at each end of a line. The outer one is the maximum: a bar for one, a crow's foot for many. The inner one is the minimum: a bar for at least one, a circle for zero. So a circle and a crow's foot means zero or many.

ER diagram templates

Related tools

ER diagram guides

Questions

Can it generate the diagram from my database?
From its schema, yes. Paste CREATE TABLE statements into the SQL to ER diagram tool. It works from text, so it never needs a database connection or credentials.
Can I export SQL from a diagram?
No. The editor exports images, draw.io files and JSON. It reads SQL but does not write it.
What is crow's foot notation?
A way of drawing relationship lines where the line ending shows cardinality: a three-pronged "crow's foot" means many, a bar means one and a circle means zero. It is the most widely used notation for relational database diagrams.

Other diagram types