shopping

Tables (5)

category

  • category_id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • created_at — DATETIME — NOT NULL

member

  • member_id — Foreign — Primary key — NOT NULL
  • email — VARCHAR(100) — NOT NULL
  • password_hash — VARCHAR(255) — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • phone — VARCHAR(20) — NOT NULL
  • address — VARCHAR(200)
  • role — ENUM('USER','ADMIN') — NOT NULL
  • created_at — DATETIME — NOT NULL

order_item

  • order_item_id — BIGINT — Primary key — NOT NULL
  • quantity — INT — NOT NULL
  • unit_price — INT — NOT NULL
  • product_id — BIGINT — Foreign key → product.product_id — NOT NULL
  • order_id — BIGINT — Foreign key → orders.order_id — NOT NULL

orders

  • order_id — BIGINT — Primary key — NOT NULL
  • member_id — Foreign — NOT NULL
  • order_date — DATETIME — NOT NULL
  • order_status — ENUM('PAYMENT','SHIPPING','DONE','CANCEL') — NOT NULL
  • total_price — INT — NOT NULL
  • shipping_addr — VARCHAR(200) — NOT NULL
  • category_id — BIGINT — Foreign key → category.category_id — NOT NULL

product

  • product_id — BIGINT — Primary key — NOT NULL
  • category_id — Foreign — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • price — INT — NOT NULL
  • stock — INT — NOT NULL
  • description — VARCHAR(500)
  • status — ENUM('SALE','SOLD_OUT','HIDDEN') — NOT NULL
  • created_at — DATETIME — NOT NULL
  • member_id — Foreign — Foreign key → member.member_id — NOT NULL