Mermaid ER diagram in Markdown to PDF
Entities with typed attributes and key markers are joined by relationships with crow's-foot cardinalities.
Crow's-foot cardinalities, identifying and non-identifying relationships, and typed attribute blocks with key markers, for an airline booking model.
Markdown source
Markdown · 54 lines# Entity relationship diagrams
```mermaid
erDiagram
PASSENGER ||--o{ BOOKING : makes
BOOKING ||--|{ TICKET : contains
TICKET }o--|| FLIGHT : "is for"
FLIGHT }o--|| AIRCRAFT : "operated with"
FLIGHT }o--|| AIRPORT : "departs from"
FLIGHT }o--|| AIRPORT : "arrives at"
TICKET |o--o| SEAT : "assigned"
PASSENGER {
string passenger_id PK
string full_name
string passport_no UK "as printed"
date date_of_birth
string nationality
}
BOOKING {
string record_locator PK "six letters"
string passenger_id FK
timestamp booked_at
string currency
decimal total
}
TICKET {
string ticket_no PK "13 digits"
string record_locator FK
string flight_no FK
string fare_class
int bag_allowance_kg
}
FLIGHT {
string flight_no PK
date flight_date PK
string origin FK
string destination FK
time departure_local
int duration_min
}
AIRPORT {
string iata PK "three letters"
string name
string city
string country
string timezone
}
SEAT {
string flight_no FK
string seat PK "row and letter"
boolean exit_row
}
```
Rendered pages
PDF · 1 page · 12 KBThe sample documents describe invented organizations in several countries. All names and figures are illustrative.
Mermaid diagrams in Markdown to PDF: every sampleIn the Markdown reference
