CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
🌙☀️
Log inStart free
Home/Templates/Student Projects (College Reports)

🎓 Student Projects (College Reports) · Database ERD

Online Shopping System ER Diagram

The core e-commerce schema: customers, addresses, products, categories, carts, orders, order items, payments and reviews.

More Student Projects (College Reports) 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

  • Order items hold the price at the time of purchase
  • Customer addresses kept separately
  • Reviews linked to both customer and product

Prompt used

ER diagram for an online shopping system: Customer with Addresses; Category and Product (sold by a Seller, with price and stock); Cart and CartItem; Order (placed by a customer to an address) with OrderItems storing quantity and unit price; Payment for an order; Review of a product by a customer.

Mermaid code
erDiagram
  CUSTOMER ||--o{ ADDRESS : has
  CUSTOMER ||--|| CART : owns
  CART ||--o{ CART_ITEM : contains
  PRODUCT ||--o{ CART_ITEM : "added as"
  CATEGORY ||--o{ PRODUCT : groups
  SELLER ||--o{ PRODUCT : sells
  CUSTOMER ||--o{ ORDERS : places
  ADDRESS ||--o{ ORDERS : "delivered to"
  ORDERS ||--|{ ORDER_ITEM : contains
  PRODUCT ||--o{ ORDER_ITEM : "ordered as"
  ORDERS ||--o| PAYMENT : "paid by"
  CUSTOMER ||--o{ REVIEW : writes
  PRODUCT ||--o{ REVIEW : receives
  CUSTOMER {
    int customer_id PK
    string name
    string email
  }
  ADDRESS {
    int address_id PK
    int customer_id FK
    string city
    string pincode
  }
  SELLER {
    int seller_id PK
    string name
    string gstin
  }
  CATEGORY {
    int category_id PK
    string name
  }
  PRODUCT {
    int product_id PK
    int category_id FK
    int seller_id FK
    string name
    decimal price
    int stock
  }
  CART {
    int cart_id PK
    int customer_id FK
  }
  CART_ITEM {
    int cart_id FK
    int product_id FK
    int quantity
  }
  ORDERS {
    int order_id PK
    int customer_id FK
    int address_id FK
    date ordered_on
    string status
  }
  ORDER_ITEM {
    int order_id FK
    int product_id FK
    int quantity
    decimal unit_price
  }
  PAYMENT {
    int payment_id PK
    int order_id FK
    decimal amount
    string method
  }
  REVIEW {
    int review_id PK
    int customer_id FK
    int product_id FK
    int rating
  }

Inside this diagram

An entity relationship diagram with 11 tables, 40 columns and 13 relationships.

Tables and their columns

  • CUSTOMER: customer_id (PK), name, email
  • ADDRESS: address_id (PK), customer_id (FK), city, pincode
  • CART: cart_id (PK), customer_id (FK)
  • CART_ITEM: cart_id (FK), product_id (FK), quantity
  • PRODUCT: product_id (PK), category_id (FK), seller_id (FK), name, price, stock
  • CATEGORY: category_id (PK), name
  • SELLER: seller_id (PK), name, gstin
  • ORDERS: order_id (PK), customer_id (FK), address_id (FK), ordered_on, status
  • ORDER_ITEM: order_id (FK), product_id (FK), quantity, unit_price
  • PAYMENT: payment_id (PK), order_id (FK), amount, method
  • REVIEW: review_id (PK), customer_id (FK), product_id (FK), rating

Relationships

  • CUSTOMER has ADDRESS: each CUSTOMER has zero or more ADDRESS, each ADDRESS belongs to exactly one CUSTOMER
  • CUSTOMER owns CART: each CUSTOMER has exactly one CART, each CART belongs to exactly one CUSTOMER
  • CART contains CART_ITEM: each CART has zero or more CART_ITEM, each CART_ITEM belongs to exactly one CART
  • PRODUCT added as CART_ITEM: each PRODUCT has zero or more CART_ITEM, each CART_ITEM belongs to exactly one PRODUCT
  • CATEGORY groups PRODUCT: each CATEGORY has zero or more PRODUCT, each PRODUCT belongs to exactly one CATEGORY
  • SELLER sells PRODUCT: each SELLER has zero or more PRODUCT, each PRODUCT belongs to exactly one SELLER
  • CUSTOMER places ORDERS: each CUSTOMER has zero or more ORDERS, each ORDERS belongs to exactly one CUSTOMER
  • ADDRESS delivered to ORDERS: each ADDRESS has zero or more ORDERS, each ORDERS belongs to exactly one ADDRESS
  • ORDERS contains ORDER_ITEM: each ORDERS has one or more ORDER_ITEM, each ORDER_ITEM belongs to exactly one ORDERS
  • PRODUCT ordered as ORDER_ITEM: each PRODUCT has zero or more ORDER_ITEM, each ORDER_ITEM belongs to exactly one PRODUCT
  • ORDERS paid by PAYMENT: each ORDERS has zero or one PAYMENT, each PAYMENT belongs to exactly one ORDERS
  • CUSTOMER writes REVIEW: each CUSTOMER has zero or more REVIEW, each REVIEW belongs to exactly one CUSTOMER
  • PRODUCT receives REVIEW: each PRODUCT has zero or more REVIEW, each REVIEW belongs to exactly one PRODUCT

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

Use CaseStudent Projects (College Reports)

Library Management System Use Case Diagram

Who uses a college library system and what each of them can do: members, the librarian and the system administrator.

Database ERDStudent Projects (College Reports)

Library Management System ER Diagram

The database of a library system: books and their copies, authors, members, loans, reservations and fines, with keys and cardinality.

Data FlowStudent Projects (College Reports)

Library Management System Data Flow Diagram (Level 1)

How data moves through a library system: members and the librarian, the main processes, and the data stores they read and write.

Class UMLStudent Projects (College Reports)

Library Management System Class Diagram

The main classes of a library system with attributes, methods and UML relationships.

SequenceStudent Projects (College Reports)

Library Management System Sequence Diagram (Issue a Book)

The steps when a member borrows a book: checks, loan record and the copy status update.

Use CaseStudent Projects (College Reports)

Online Examination System Use Case Diagram

What students, examiners and the administrator do in an online examination system.