CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
🌙☀️
Log inStart free
Home/Templates/Retail & E-commerce

🛒 Retail & E-commerce · Database ERD

Product Catalog Database Schema

A flexible product catalog: categories, products with variants (size, colour), prices, stock per warehouse and images.

More Retail & E-commerce templates

Opening a template is free and never counts toward your daily diagrams. Asking the AI to change it counts as one.

Drawing diagram…

What this diagram shows

  • Products have variants (SKUs) such as size and colour
  • Stock is tracked per SKU per warehouse
  • Categories can be nested

Prompt used

ERD for an e-commerce catalog: Category (with parent category), Product in a Category, Brand, ProductVariant (SKU) with attributes like size and colour, Price per variant with sale price, Inventory per variant per Warehouse, and ProductImage.

Mermaid code
erDiagram
  CATEGORY ||--o{ CATEGORY : "parent of"
  CATEGORY ||--o{ PRODUCT : contains
  BRAND ||--o{ PRODUCT : makes
  PRODUCT ||--|{ PRODUCT_VARIANT : "sold as"
  PRODUCT ||--o{ PRODUCT_IMAGE : shows
  PRODUCT_VARIANT ||--|| PRICE : "priced at"
  PRODUCT_VARIANT ||--o{ INVENTORY : stocked
  WAREHOUSE ||--o{ INVENTORY : holds
  PRODUCT {
    int id PK
    int category_id FK
    int brand_id FK
    string title
  }
  PRODUCT_VARIANT {
    int id PK
    int product_id FK
    string sku
    string size
    string colour
  }
  PRICE {
    int variant_id FK
    decimal mrp
    decimal sale_price
  }
  INVENTORY {
    int variant_id FK
    int warehouse_id FK
    int quantity
  }

Inside this diagram

An entity relationship diagram with 8 tables, 15 columns and 8 relationships.

Tables and their columns

  • CATEGORY
  • PRODUCT: id (PK), category_id (FK), brand_id (FK), title
  • BRAND
  • PRODUCT_VARIANT: id (PK), product_id (FK), sku, size, colour
  • PRODUCT_IMAGE
  • PRICE: variant_id (FK), mrp, sale_price
  • INVENTORY: variant_id (FK), warehouse_id (FK), quantity
  • WAREHOUSE

Relationships

  • CATEGORY parent of CATEGORY: each CATEGORY has zero or more CATEGORY, each CATEGORY belongs to exactly one CATEGORY
  • CATEGORY contains PRODUCT: each CATEGORY has zero or more PRODUCT, each PRODUCT belongs to exactly one CATEGORY
  • BRAND makes PRODUCT: each BRAND has zero or more PRODUCT, each PRODUCT belongs to exactly one BRAND
  • PRODUCT sold as PRODUCT_VARIANT: each PRODUCT has one or more PRODUCT_VARIANT, each PRODUCT_VARIANT belongs to exactly one PRODUCT
  • PRODUCT shows PRODUCT_IMAGE: each PRODUCT has zero or more PRODUCT_IMAGE, each PRODUCT_IMAGE belongs to exactly one PRODUCT
  • PRODUCT_VARIANT priced at PRICE: each PRODUCT_VARIANT has exactly one PRICE, each PRICE belongs to exactly one PRODUCT_VARIANT
  • PRODUCT_VARIANT stocked INVENTORY: each PRODUCT_VARIANT has zero or more INVENTORY, each INVENTORY belongs to exactly one PRODUCT_VARIANT
  • WAREHOUSE holds INVENTORY: each WAREHOUSE has zero or more INVENTORY, each INVENTORY belongs to exactly one WAREHOUSE

Make your own diagram like this

Describe your own system in plain English and the AI ER diagram generator draws it in seconds, in the same style as this template.

Related templates

C4 ArchitectureProRetail & E-commerce

E-commerce Microservices Architecture

An online store split into microservices: catalog, cart, orders, payments and search, with Kafka events connecting them to shipping and notifications.

SequenceRetail & E-commerce

Checkout and Payment Sequence

What happens when a shopper clicks Pay: stock is reserved, the payment is authorised, the order is created and stock is released again if payment fails.

State MachineRetail & E-commerce

Order Lifecycle State Machine

Every status an online order moves through, from placed to delivered, including cancellations, returns and refunds.

Data FlowRetail & E-commerce

Omnichannel Inventory Sync

How stock stays in sync across stores, warehouses and marketplaces so the same item isn't sold twice.

FlowchartRetail & E-commerce

Returns and Refunds Workflow

How an online store handles a return: eligibility, pickup, quality check at the warehouse and the refund or replacement.

Data FlowRetail & E-commerce

Product Recommendation Engine

How an online store builds 'recommended for you' and 'frequently bought together': click and order data, model training and a fast serving layer.