Orders schema
Try this
- Add
string phoneinside the CUSTOMER block. - Mark a key: change
int idtoint id PK.
An entity relationship diagram shows your tables and how they link. In Mermaid each relationship is one line of crow's foot notation, like CUSTOMER ||--o{ ORDER : places. Edit the example and it redraws.
Free in your browser. On a Mac, TypeFire opens every .md file like this, right from Finder.Download free for Mac
string phone inside the CUSTOMER block.int id to int id PK.This editor comes from TypeFire, free for Mac
Your whole folder of Markdown notes in tabs, Quick Look previews in Finder, plus a text expander and a clipboard manager.
Start with erDiagram, then one line per relationship: CUSTOMER ||--o{ ORDER : places.
Each end has two marks: the outer one is the most, the inner one is the fewest. { means many, | means one, o means zero.
Add a block like ORDER { int id PK } with a type and a name on each line. PK, FK and UK mark keys.

On the Mac, every Mermaid block in your notes draws in TypeFire's colors. Open one full window to zoom in, resize it, link a box to another note, and save it as SVG or PNG.
Free text expander, markdown notes and a clipboard manager. $18 once for unlimited clips, notes sync and AI prompts.
Read each end of the line on its own.
Drawn from the example above
The text after the colon is the verb. Quote it if it has spaces: "appears in".
-- draws a solid line for a relationship that identifies the child. .. draws a dashed one for one that doesn't.
PK, FK and UK after an attribute mark primary, foreign and unique keys.
Draw the tables a change touches, not the whole schema, and the diagram stays readable.

This editor comes from TypeFire, a free app for Markdown notes, a text expander and a clipboard manager. Here it works on the files you open. In the app, it opens your whole folder.


Still not answered?
Write a Mermaid erDiagram in a code block marked mermaid, with one line per relationship and an optional block of attributes per entity.
Exactly one on the left, zero or more on the right.
CUSTOMER ||--o{ ORDER means one customer places zero or more orders.
Add PK after the attribute: int id PK. FK marks a foreign key and UK a unique one.
-- is an identifying relationship, drawn solid. .. is non-identifying, drawn dashed.
Yes. Put it in quotes at the end of the line: string email "login address".
Zoom, resize, link a box to a note
The Mermaid syntax guideEvery diagram kind, with examples
Diagrams from ChatGPT or ClaudePrompts that draw the first time
TypeFire for Mac draws ER diagrams in your notes, with a viewer to zoom in on big schemas. Free.
Free text expander, markdown notes and a clipboard manager. $18 once for unlimited clips, notes sync and AI prompts.
⌘⌃2 your clips⌘⌃1 your snippets