FlowDiagram
Retail & e-commerce operationsDBML

Retail store & inventory schema template

Stores, products and sales — a compact schema for a multi-location retail system. This data model has 7 tables and 30 columns, joined by 8 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

  • stores — 4 columns
  • employees — 4 columns
  • products — 4 columns
  • store_inventory — 4 columns
  • customers — 3 columns
  • sales — 6 columns
  • sale_lines — 5 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 stores {
  id integer [pk]
  name varchar
  city varchar
  opened_on date
}

Table employees {
  id integer [pk]
  store_id integer [ref: > stores.id]
  name varchar
  role varchar
}

Table products {
  id integer [pk]
  sku varchar [unique]
  name varchar
  price decimal
}

Table store_inventory {
  id integer [pk]
  store_id integer [ref: > stores.id]
  product_id integer [ref: > products.id]
  on_hand integer
}

Table customers {
  id integer [pk]
  loyalty_no varchar [unique]
  email varchar
}

Table sales {
  id integer [pk]
  store_id integer [ref: > stores.id]
  employee_id integer [ref: > employees.id]
  customer_id integer [ref: > customers.id]
  sold_at timestamp
  total decimal
}

Table sale_lines {
  id integer [pk]
  sale_id integer [ref: > sales.id]
  product_id integer [ref: > products.id]
  quantity integer
  unit_price decimal
}

Related: Database schema diagram tool · All retail & e-commerce operations templates · All 521 templates