Asset 20 8 2
Does AI recommend your business? Run the free check →

Join 15,000 business owners, marketers and entrepreneurs. The Sunday newsletter you'll be annoyed only arrives once a week.

Article

How to Draw an ER Diagram Step by Step

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.

RouteHow you build itHow lines get madeExtras
Lucidchart, in the browserAdd 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 textStart 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.

  1. Pin down purpose and scope: which system it's for, who'll use it and which questions it has to answer.
  2. List your entities, such as customers, orders and products. In Mermaid they're named with singular nouns, so CUSTOMER rather than CUSTOMERS.
  3. 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.
  4. 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.
  5. 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.
  6. Choose a notation, such as Crow's Foot or Chen, and a level: conceptual, logical or physical.
  7. 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.
  8. 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.

Work with me

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.

Published and maintained by the Lilach Bullock team, covering marketing, AI and business growth.
Your buyers are asking AI who to use. Does it say you?

See for free whether ChatGPT, Claude, Perplexity, Gemini and Google name you, and get the plan to become the answer.

Check my AI visibility →
Sundays only

Get the Sunday newsletter.

One email a week. AI experiments, marketing tactics, and the workflows Lilach is building right now in her own business.

Subscribe free

Let’s get your marketing running on AI.

Book a free 30-minute call

We figure out what you need, where AI fits in, and what working together would look like.

Book the call →

Or take the 30-second calculator

You’ll see the hours and the money quietly leaking out of your week, and the three workflows worth building first.

Take the calculator →

Or grab the free AI resource library

Prompt packs, templates, checklists, and swipe files. The exact tools I build for paying clients. Yours, free.

Get the library →
Keep reading

More from the blog.