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:

ERD

The source, which you can paste into a new diagram and edit:

[Person]
*id
name
height
+department_id

[Department]
*id
name
budget

[Project]
*id
name
+lead_id

Person *--1 Department
Project *--1 Person

#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.



Learn one properly. Borrow the rest when you need them.