
π Student Projects (College Reports) Β· Database ERD
The core e-commerce schema: customers, addresses, products, categories, carts, orders, order items, payments and reviews.
Drawing diagramβ¦
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.
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
}Who uses a college library system and what each of them can do: members, the librarian and the system administrator.
The database of a library system: books and their copies, authors, members, loans, reservations and fines, with keys and cardinality.
How data moves through a library system: members and the librarian, the main processes, and the data stores they read and write.
The main classes of a library system with attributes, methods and UML relationships.
The steps when a member borrows a book: checks, loan record and the copy status update.
What students, examiners and the administrator do in an online examination system.