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

🎓 Student Projects (College Reports) · Database ERD

Online Food Ordering System ER Diagram

The database of an online food ordering system: customers and addresses, restaurants, menu categories and items, carts, orders, payments, delivery partners, coupons and ratings.

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

  • 13 tables with primary and foreign keys
  • Orders link customer, restaurant, address, partner and coupon
  • Ratings for orders and restaurants

Prompt used

ER diagram for an online food ordering system: customers with addresses, restaurants with menu items in categories, carts with cart items, orders with order items, status and delivery address, payments, delivery partners assigned to orders, coupons applied to orders, and ratings by customers for orders and restaurants.

Mermaid code
erDiagram
    CUSTOMER {
        uuid id PK
        string full_name
        string email
        string phone
        timestamp created_at
    }
    ADDRESS {
        uuid id PK
        uuid customer_id FK
        string street_address
        string city
        string postal_code
        timestamp created_at
    }
    RESTAURANT {
        uuid id PK
        string name
        string phone
        boolean is_active
        timestamp created_at
    }
    CATEGORY {
        uuid id PK
        uuid restaurant_id FK
        string name
        integer display_order
        timestamp created_at
    }
    MENU_ITEM {
        uuid id PK
        uuid category_id FK
        string name
        decimal price
        boolean is_available
    }
    CART {
        uuid id PK
        uuid customer_id FK
        decimal total_amount
        timestamp updated_at
        timestamp created_at
    }
    CART_ITEM {
        uuid id PK
        uuid cart_id FK
        uuid menu_item_id FK
        integer quantity
        decimal unit_price
    }
    COUPON {
        uuid id PK
        string code
        decimal discount_amount
        date valid_until
        boolean is_active
    }
    DELIVERY_PARTNER {
        uuid id PK
        string name
        string phone
        string vehicle_type
        boolean is_available
    }
    ORDER {
        uuid id PK
        uuid customer_id FK
        uuid restaurant_id FK
        uuid delivery_address_id FK
        uuid delivery_partner_id FK
        uuid coupon_id FK
        string status
        decimal total_amount
        timestamp created_at
    }
    ORDER_ITEM {
        uuid id PK
        uuid order_id FK
        uuid menu_item_id FK
        integer quantity
        decimal unit_price
    }
    PAYMENT {
        uuid id PK
        uuid order_id FK
        string payment_method
        string payment_status
        decimal amount
        timestamp created_at
    }
    RATING {
        uuid id PK
        uuid order_id FK
        uuid customer_id FK
        uuid restaurant_id FK
        integer score
        string review_text
        timestamp created_at
    }

    CUSTOMER ||--o{ ADDRESS : "has"
    CUSTOMER ||--o{ CART : "owns"
    CUSTOMER ||--o{ ORDER : "places"
    CUSTOMER ||--o{ RATING : "writes"
    RESTAURANT ||--o{ CATEGORY : "offers"
    RESTAURANT ||--o{ ORDER : "fulfills"
    RESTAURANT ||--o{ RATING : "receives"
    CATEGORY ||--o{ MENU_ITEM : "contains"
    CART ||--o{ CART_ITEM : "contains"
    MENU_ITEM ||--o{ CART_ITEM : "added_to"
    MENU_ITEM ||--o{ ORDER_ITEM : "ordered_in"
    ADDRESS ||--o{ ORDER : "used_as_delivery"
    DELIVERY_PARTNER ||--o{ ORDER : "assigned_to"
    COUPON ||--o{ ORDER : "applied_to"
    ORDER ||--o{ ORDER_ITEM : "includes"
    ORDER ||--o{ PAYMENT : "paid_via"
    ORDER ||--o{ RATING : "rated_in"

Inside this diagram

An entity relationship diagram with 13 tables, 73 columns and 17 relationships.

Tables and their columns

  • CUSTOMER: id (PK), full_name, email, phone, created_at
  • ADDRESS: id (PK), customer_id (FK), street_address, city, postal_code, created_at
  • RESTAURANT: id (PK), name, phone, is_active, created_at
  • CATEGORY: id (PK), restaurant_id (FK), name, display_order, created_at
  • MENU_ITEM: id (PK), category_id (FK), name, price, is_available
  • CART: id (PK), customer_id (FK), total_amount, updated_at, created_at
  • CART_ITEM: id (PK), cart_id (FK), menu_item_id (FK), quantity, unit_price
  • COUPON: id (PK), code, discount_amount, valid_until, is_active
  • DELIVERY_PARTNER: id (PK), name, phone, vehicle_type, is_available
  • ORDER: id (PK), customer_id (FK), restaurant_id (FK), delivery_address_id (FK), delivery_partner_id (FK), coupon_id (FK), status, total_amount, created_at
  • ORDER_ITEM: id (PK), order_id (FK), menu_item_id (FK), quantity, unit_price
  • PAYMENT: id (PK), order_id (FK), payment_method, payment_status, amount, created_at
  • RATING: id (PK), order_id (FK), customer_id (FK), restaurant_id (FK), score, review_text, created_at

Relationships

  • CUSTOMER has ADDRESS: each CUSTOMER has zero or more ADDRESS, each ADDRESS belongs to exactly one CUSTOMER
  • CUSTOMER owns CART: each CUSTOMER has zero or more CART, each CART belongs to exactly one CUSTOMER
  • CUSTOMER places ORDER: each CUSTOMER has zero or more ORDER, each ORDER belongs to exactly one CUSTOMER
  • CUSTOMER writes RATING: each CUSTOMER has zero or more RATING, each RATING belongs to exactly one CUSTOMER
  • RESTAURANT offers CATEGORY: each RESTAURANT has zero or more CATEGORY, each CATEGORY belongs to exactly one RESTAURANT
  • RESTAURANT fulfills ORDER: each RESTAURANT has zero or more ORDER, each ORDER belongs to exactly one RESTAURANT
  • RESTAURANT receives RATING: each RESTAURANT has zero or more RATING, each RATING belongs to exactly one RESTAURANT
  • CATEGORY contains MENU_ITEM: each CATEGORY has zero or more MENU_ITEM, each MENU_ITEM belongs to exactly one CATEGORY
  • CART contains CART_ITEM: each CART has zero or more CART_ITEM, each CART_ITEM belongs to exactly one CART
  • MENU_ITEM added_to CART_ITEM: each MENU_ITEM has zero or more CART_ITEM, each CART_ITEM belongs to exactly one MENU_ITEM
  • MENU_ITEM ordered_in ORDER_ITEM: each MENU_ITEM has zero or more ORDER_ITEM, each ORDER_ITEM belongs to exactly one MENU_ITEM
  • ADDRESS used_as_delivery ORDER: each ADDRESS has zero or more ORDER, each ORDER belongs to exactly one ADDRESS
  • DELIVERY_PARTNER assigned_to ORDER: each DELIVERY_PARTNER has zero or more ORDER, each ORDER belongs to exactly one DELIVERY_PARTNER
  • COUPON applied_to ORDER: each COUPON has zero or more ORDER, each ORDER belongs to exactly one COUPON
  • ORDER includes ORDER_ITEM: each ORDER has zero or more ORDER_ITEM, each ORDER_ITEM belongs to exactly one ORDER
  • ORDER paid_via PAYMENT: each ORDER has zero or more PAYMENT, each PAYMENT belongs to exactly one ORDER
  • ORDER rated_in RATING: each ORDER has zero or more RATING, each RATING belongs to exactly one ORDER

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.