Tables in this data model
- members — 5 columns
- membership_plans — 4 columns
- memberships — 6 columns
- trainers — 3 columns
- class_types — 4 columns
- class_sessions — 5 columns
- class_bookings — 5 columns
- check_ins — 4 columns
How to use this ER diagram template
- Click Open in the editor. The ER diagram opens on a new page in FlowDiagram — nothing is uploaded and there is no sign-up.
- Rename, add or delete shapes and drag them where you want; connectors stay attached as things move.
- Drop in vendor logos from the library — 1,160 of them, including every AWS, Azure and Google Cloud service icon — or restyle it with the colour and theme controls.
- Prefer text? Edit the DBML below and paste it in through ☰ → Import diagram; the finished model exports to SQL DDL or back to DBML.
- Export to PNG, SVG or PDF, or press Ctrl+L for a link that carries the whole diagram.
DBML source
The whole template is the text below. Paste it into FlowDiagram, keep it in Git next to the code it describes, or hand it to an AI assistant to extend.
Table members {
id integer [pk]
name varchar
email varchar [unique]
phone varchar
joined_on date
}
Table membership_plans {
id integer [pk]
name varchar
monthly_fee decimal
class_credits integer
}
Table memberships {
id integer [pk]
member_id integer [ref: > members.id]
plan_id integer [ref: > membership_plans.id]
status varchar
starts_on date
ends_on date
}
Table trainers {
id integer [pk]
name varchar
specialty varchar
}
Table class_types {
id integer [pk]
name varchar
duration_minutes integer
capacity integer
}
Table class_sessions {
id integer [pk]
class_type_id integer [ref: > class_types.id]
trainer_id integer [ref: > trainers.id]
starts_at timestamp
room varchar
}
Table class_bookings {
id integer [pk]
session_id integer [ref: > class_sessions.id]
member_id integer [ref: > members.id]
status varchar
booked_at timestamp
}
Table check_ins {
id integer [pk]
member_id integer [ref: > members.id]
checked_in_at timestamp
location varchar
}
Related: Database schema diagram tool · All database & er models templates · All 521 templates