ER: E-Commerce Schema

Full e-commerce database schema with customers, orders, products, and line items.

er-e-commerce-schema.mmd
erDiagram
  CUSTOMER {
    int id PK
    string name
    string email UK
  }
  ORDER {
    int id PK
    date created
    int customer_id FK
  }
  PRODUCT {
    int id PK
    string name
    float price
  }
  LINE_ITEM {
    int id PK
    int order_id FK
    int product_id FK
    int quantity
  }
  CUSTOMER ||--o{ ORDER : places
  ORDER ||--|{ LINE_ITEM : contains
  PRODUCT ||--o{ LINE_ITEM : includes
Output
ER diagram, Zombie Mermaid CUSTOMER PK int id string name UK string email ORDER PK int id date created FK int customer_id PRODUCT PK int id string name float price LINE_ITEM PK int id FK int order_id FK int product_id int quantity places contains includes

More ER diagram examples