ERD
The ERD format is a small, focused language for entity relationship diagrams: entities, attributes with key markers, and relationships written with cardinality symbols.
It is a good fit when you want classic ER output and find Mermaid's ER syntax limiting.
#What it is good at
Classic ER diagrams with explicit key and attribute markers.
Academic or specification contexts where the notation is expected.
Schemas where you want attributes listed but not full column types.
#What it draws
Diagram | Syntax starts with |
|---|---|
Entity | [Person] |
Primary key | *name |
Foreign key | +department_id |
Attribute | height |
Relationship | Person *--1 Department |
#A worked example
Entities, keys and cardinality:
The source, which you can paste into a new diagram and edit:
#A few things that catch people out
The cardinality symbols are ?, 1, * and +, and they go on both sides of the relationship.
Attributes are listed under the entity, one per line, with * marking keys.
For types, defaults and indexes, DBML is the better tool.
#Related
Learn one properly. Borrow the rest when you need them.
