FlowDiagram
Database & ER modelsDBML

Gym membership & classes schema (DBML) template

Members, membership plans, memberships, trainers, class types, scheduled classes, bookings and check-ins for a fitness club. This data model has 8 tables and 36 columns, joined by 7 relationships. FlowDiagram draws it as an entity-relationship diagram with crow's-foot notation.

Open in the editor →
  • Free — no account, no trial, no watermark
  • Fully editable shapes and connectors, not a screenshot
  • Export PNG, SVG or PDF, or share it as a link
  • Private: the diagram never leaves your browser

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

  1. Click Open in the editor. The ER diagram opens on a new page in FlowDiagram — nothing is uploaded and there is no sign-up.
  2. Rename, add or delete shapes and drag them where you want; connectors stay attached as things move.
  3. 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.
  4. Prefer text? Edit the DBML below and paste it in through ☰ → Import diagram; the finished model exports to SQL DDL or back to DBML.
  5. 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