Templates / E-commerce

E-commerce Database Schema (ERD Template)

A ready-to-use e-commerce database schema: customers place orders, orders contain items that reference a product catalog organized by category, and payments settle orders. Foreign keys carry explicit ON DELETE rules — order items cascade with their order, while products can't be deleted while orders reference them.

E-commerce ER diagram in the Sqemo editor

Tables

TablePurpose
customers Shopper accounts with unique emails
categories Product catalog grouping
products Sellable items with price and stock
orders One checkout per row, status-tracked
order_items Order ↔ product line items
payments Settlements against an order

Schema highlights

How to use it

  1. Click Open in Sqemo — the template loads as a new local project (nothing is uploaded, no account needed).
  2. Rename entities and attributes; physical names follow your glossary and naming rules automatically.
  3. Export CREATE TABLE SQL for MySQL, PostgreSQL, SQL Server, Oracle, SQLite, H2, or CUBRID — or DBML.

Prefer your own baseline? Import SQL or DBML and Sqemo builds the diagram, foreign keys included.