OnlineShop Practice
Website
- Login with your account
tungnt@softech.vn
/123456789
- Go to Online Shop, go to Data Management
Requirements
Messages
- Kế thừa từ các messages của API
Entities
Categories
Id | Column Name | Data Type | Null | Key | Default | Constraint |
---|---|---|---|---|---|---|
1 | Id | int | PK | AUTONUMBER | ||
2 | Name | string(50) | UNIQUE | |||
3 | Description | string(500) | yes |
Suppliers
Id | Column Name | Data Type | Null | Key | Default | Constraint |
---|---|---|---|---|---|---|
1 | Id | int | PK | AUTONUMBER | ||
2 | Name | string(100) | ||||
3 | string(50) | UNIQUE | ||||
4 | PhoneNumber | string(50) | UNIQUE | |||
5 | Address | string(500) |
Customers
Id | Column Name | Data Type | Null | Key | Default | Constraint |
---|---|---|---|---|---|---|
1 | Id | int | PK | AUTONUMBER | ||
2 | FirstName | string(50) | ||||
3 | LastName | string(50) | ||||
4 | string(50) | UNIQUE | ||||
5 | PhoneNumber | string(50) | UNIQUE | |||
6 | Address | string(500) | ||||
7 | Birthday | datetime | yes |
Employees
Id | Column Name | Data Type | Null | Key | Default | Constraint |
---|---|---|---|---|---|---|
1 | Id | int | PK | AUTONUMBER | ||
2 | FirstName | string(50) | ||||
3 | LastName | string(50) | ||||
4 | string(50) | UNIQUE | ||||
5 | PhoneNumber | string(50) | UNIQUE | |||
6 | Address | string(500) | ||||
7 | Birthday | datetime | yes |
Products
Id | Column Name | Data Type | Null | Key | Default | Constraint |
---|---|---|---|---|---|---|
1 | Id | int | PK | AUTONUMBER | ||
2 | Name | string(100) | ||||
3 | Price | float | Price > 0 | |||
4 | Discount | float | 0 | 0 <= Discount <= 90 | ||
5 | Stock | float | 0 | Stock >= 0 | ||
6 | Description | string(max) | yes | |||
7 | CategoryId | int | FK | Refrence to Categories (Id) | ||
8 | SupplierId | int | FK | Refrence to Suppliers (Id) |
Orders
Id | Column Name | Data Type | Null | Key | Default | Constraint |
---|---|---|---|---|---|---|
1 | Id | int | PK | AUTONUMBER | ||
2 | CreatedDate | datetime | NOW | |||
3 | ShippedDate | datetime | yes | ShippedDate ?= CreatedDate | ||
4 | Status | string(50) | WAITING | Status in [WAINTING, COMPLETED, CANCELED] | ||
5 | Description | string(max) | ||||
6 | ShippingAddress | string(500) | yes | |||
7 | ShippingCity | string(50) | ||||
8 | PaymentType | string(20) | CASH | PaymentType in [CASH, CREDIT CARD] | ||
9 | CustomerId | int | FK | Refrence to Customers (Id) | ||
10 | EmployeeId | int | FK | Refrence to Employees (Id) |
Order Details
Id | Column Name | Data Type | Null | Key | Default | Constraint |
---|---|---|---|---|---|---|
1 | OrderId | int | PK + FK | Refrence to Orders (Id) | ||
2 | ProductId | int | PK + FK | Refrence to Products (Id) | ||
3 | Quantity | float | Quantity > 0 | |||
4 | Price | float | Price > 0 | |||
5 | Discount | float | 0 <= Discount <=90 |