REAL PROJECT

Tables (8)

QNA (Untitled2)

  • id — LONG — Primary key — NOT NULL
  • cust_id — LONG — Foreign key → customer.id — NOT NULL
  • contents — TEXT
  • title — VARCHAR(40)
  • created_at — DATETIME
  • updated_at — DATETIME
  • status — ENUM('WAITING' , 'COMPLETE')

cart (Untitled)

  • id — LONG — Primary key — NOT NULL
  • custmer_id (customer_id) — LONG — Foreign key → customer.id — NOT NULL
  • goods_id — LONG — Foreign key → goods.id — NOT NULL

customer

  • id — LONG — Primary key — NOT NULL
  • email — VARCHAR(100) — NOT NULL
  • password — VARCHAR(100) — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • phone_number — VARCHAR(20) — NOT NULL
  • address — VARCHAR(255)
  • status — ENUM('ACTIVE', 'INACTIVE') — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

goods

  • id — LONG — Primary key — NOT NULL
  • name — VARCHAR(255) — NOT NULL
  • price — INT — NOT NULL
  • stock_quantity — INT — NOT NULL
  • description — TEXT
  • main_image_url — VARCHAR(255)
  • status — ENUM('SALE', 'SOLD_OUT', 'HIDDEN') — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL
  • category — varchar(40)

like

  • id — LONG — Primary key — NOT NULL
  • user_id — LONG — Foreign key → customer.id — NOT NULL
  • goods_id — LONG — Foreign key → goods.id — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME

order

  • id — LONG — Primary key — NOT NULL
  • customer_id — LONG — Foreign key → customer.id — NOT NULL
  • order_date — DATETIME — NOT NULL
  • total_amount — DOUBLE — NOT NULL
  • status — ENUM('PENDING_PAYMENT', 'PAID', 'PREPARING_SHIPMENT', 'SHIPPED', 'DELIVERED', 'CANCELLED', 'REFUNDED') — NOT NULL
  • shipping_address — VARCHAR(255) — NOT NULL
  • receiver_name — VARCHAR(50) — NOT NULL
  • shipping_phone_number — VARCHAR(20) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

order_item

  • id — LONG — Primary key — NOT NULL
  • order_id — LONG — Foreign key → order.customer_id — NOT NULL
  • goods_id — LONG — Foreign key → goods.id — NOT NULL
  • quantity — INT — NOT NULL

review

  • id — LONG — Primary key — NOT NULL
  • goods_id — LONG — Foreign key → goods.id — NOT NULL
  • cust_id — LONG — Foreign key → customer.id — NOT NULL
  • title — VARCHAR(100) — NOT NULL
  • content — TEXT — NOT NULL
  • rating — INT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL