E-Commerse
Tables (6)
Coupon (쿠폰)
- 쿠폰 ID (coupon_id) — int — Primary key — NOT NULL
- 할인률 (discount_rate) — int
- 생성날짜 (created_at) — datetime
- 수정날짜 (updated_at) — datetime
- 선착순 수량 (remaining_count) — int
Order (주문)
- 주문 ID (order_id) — int — Primary key — NOT NULL
- 유저 ID (user_id) — int — Foreign key → User.유저 ID — NOT NULL
- 주문상태 (status) — enum
- 총 가격 (total_amount) — int
- 총 할인액 (discount_amount) — int
- 잔액 (paid_amount) — int
- 생성날짜 (created_at) — datetime
- 수정날짜 (updated_at) — datetime
Order_Items (주문 목록)
- 상품 주문 ID (order_items_id) — int — Primary key — NOT NULL
- 상품 ID (product_id) — int — Foreign key → Product.상품 ID — NOT NULL
- 주문 ID (order_id) — int — Foreign key → Order.주문 ID — NOT NULL
- 수량 (quantity) — int
- 주문 시점 가격 (unit_price) — int
- 생성날짜 (created_at) — datetime
- 수정날짜 (updated_at) — datetime
Product (상품)
- 상품 ID (product_id) — int — Primary key — NOT NULL
- 이름 (name) — string
- 가격 (price) — int
- 잔여수량 (stock) — int
- 생성날짜 (created_at) — datetime
- 수정날짜 (updated_at) — datetime
User (유저)
- 유저 ID (user_id) — int — Primary key — NOT NULL
- 이름 (name) — string
- 잔액 (balance) — int
- 생성날짜 (created_at) — datetime
- 수정날짜 (updated_at) — datetime
User_Coupons (유저 쿠폰)
- 유저 쿠폰 ID (user_coupon_id) — int — Primary key — NOT NULL
- 유저 ID (user_id) — int — Foreign key → User.유저 ID — NOT NULL
- 쿠폰 ID (coupon_id) — int — Foreign key → Coupon.쿠폰 ID — NOT NULL
- 사용 시간 (used_at) — datetime
- 만료날짜 (deleted_at) — datetime
- 생성날짜 (created_at) — datetime