Entity relationship diagram (Mermaid)
An ER diagram is the fastest way to explain a schema to somebody who will write queries against it. Cardinality is the part that carries real information, so get it right.
#What this example shows
Crow's foot cardinality on every relationship.
Attributes with PK, FK and UK markers.
A join entity drawn explicitly rather than hidden behind a many-to-many line.
#A worked example
Open it, edit it, or copy the source below.
The source, which you can paste into a new diagram and edit:
#Making it your own
Cardinality symbols: || exactly one, |{ one or many, o{ zero or many, o| zero or one.
List the columns that matter, not all forty.
For types, defaults and indexes, DBML is the better tool.
#Related
Copy it. Change one line. See what happens.
