To draw an ER diagram, list the things your system tracks as entities, give each one attributes and a primary key, then connect them with labelled lines that show how many of each can take part. You can draw it by dragging shapes in Lucidchart or by typing it as text in Mermaid.
Lucidchart or Mermaid: two ways to draw it
Pick between dragging shapes on a canvas and typing lines of text.
| Route | How you build it | How lines get made | Extras |
|---|---|---|---|
| Lucidchart, in the browser | Add the Entity Relationship shape library and drag out shapes. Field numbers are set under Advanced Options in the right panel. | Drag from a node to another shape. Once primary and foreign keys are set up, lines are drawn for you when related tables are dragged onto the canvas. | Connected lines move with their fields. You can also import an existing database. |
| Mermaid, as text | Start with erDiagram and write your relationship lines. | You type them, for example CUSTOMER ||--o{ ORDER : places. | It renders the diagram from your text in crow's foot notation. |
If you want more options, see my free ER diagram tool list.
How to draw an ER diagram in eight steps
The notation names follow Lucid's and Mermaid's documentation.
- Pin down purpose and scope: which system it's for, who'll use it and which questions it has to answer.
- List your entities, such as customers, orders and products. In Mermaid they're named with singular nouns, so CUSTOMER rather than CUSTOMERS.
- Add attributes and choose a primary key for each entity. A primary key is the one attribute that uniquely identifies every record. You don't need every attribute listed; Mermaid says they needn't be exhaustive. There, keys are written PK, FK or UK, and a comment goes in double quotes at the end of an attribute.
- Connect related entities, label each line with a verb such as places, then set the cardinality so it's clear how many of each can take part.
- Resolve many-to-many relationships with a junction table. A table holding a foreign key to each side turns one many-to-many relationship into two one-to-many relationships, for example Order Items between orders and products.
- Choose a notation, such as Crow's Foot or Chen, and a level: conceptual, logical or physical.
- Draw it in your tool. In Lucidchart, add the Entity Relationship shape library, drag out shapes and drag from a node to another shape to make a line.
- Review each relationship against your business rules with the people who know them.
ER diagram questions people ask
What are the three main parts of an ER diagram?
Entities, their attributes and the relationships between them. Each entity gets a primary key, and each relationship gets a verb label and a cardinality.
How do you show one-to-many in an ER diagram?
With crow's foot markers on the line. In Mermaid, || means exactly one, o| zero or one, o{ zero or more and |{ one or more (those are the right-hand markers). So CUSTOMER ||--o{ ORDER : places reads as one customer placing zero or more orders. A solid line (--) marks an identifying relationship and a dashed line (..) a non-identifying one.
Want AI doing the heavy lifting in your marketing?
I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.
Can I make an ER diagram from an existing database?
Yes, in Lucidchart. You run its query for your database system, then import the CSV, TSV or TXT result, and with keys in place the related tables join up as you drag them in. Check your plan before you rely on it, as schema import from Salesforce is Enterprise only. If you're still choosing where the data lives, I've compared free database software.
Sketching your first model
Use Lucidchart if you'd rather see and drag your tables, and Mermaid if you'd rather type the whole thing as text. Either way, work through scope, keys and junction tables before you draw a single line.
Remember that a diagram doesn't create or check a database by itself, so the review with the people who know your rules isn't optional. Developers comparing more options can look at my guide to diagramming tools for developers.
