database termproject

Tables (17)

brand

  • brand_id — INT — Primary key — NOT NULL
  • brand_name — VARCHAR(100) — NOT NULL

cart

  • cart_id — INT — Primary key — NOT NULL
  • user_id — INT — Foreign key → user.user_id — NOT NULL
  • option_id — INT — Foreign key → product_option.option_id — NOT NULL
  • quantity — INT
  • added_at — TIMESTAMP

follow

  • follower_id — INT — Foreign key → user.user_id — NOT NULL
  • following_id — INT — Foreign key → user.user_id — NOT NULL

hashtag

  • hashtag_id — INT — Primary key — NOT NULL
  • tag_name — VARCHAR(50) — NOT NULL

product

  • product_id — INT — Primary key — NOT NULL
  • brand_id — INT — Foreign key → brand.brand_id — NOT NULL
  • product_name — VARCHAR(200) — NOT NULL
  • price — INT — NOT NULL
  • discount_rate — INT
  • category — VARCHAR(50)
  • gender — ENUM('여성', '공용', '남성')
  • condition_type — ENUM('새상품', '중고상품')
  • is_fast_delivery — TINYINT(1)
  • is_exclusive — TINYINT(1)
  • is_ad — TINYINT(1)
  • material — VARCHAR(50)

product_image

  • image_id — INT — Primary key — NOT NULL
  • product_id — INT — Foreign key → product.product_id — NOT NULL
  • image_url — VARCHAR(255) — NOT NULL

product_like

  • user_id — INT — Foreign key → user.user_id — NOT NULL
  • product_id — INT — Foreign key → product.product_id — NOT NULL

product_option

  • option_id — INT — Primary key — NOT NULL
  • product_id — INT — Foreign key → product.product_id — NOT NULL
  • size — VARCHAR(20) — NOT NULL
  • color — VARCHAR(20) — NOT NULL
  • stock — INT
  • shipping_date — VARCHAR(50)

review

  • review_id — INT — Primary key — NOT NULL
  • product_id — INT — Foreign key → product.product_id — NOT NULL
  • user_id — INT — Foreign key → user.user_id — NOT NULL
  • rating — INT — NOT NULL
  • content — TEXT
  • created_at — TIMESTAMP

search_keyword

  • keyword_id — INT — Primary key — NOT NULL
  • search_keyword — VARCHAR(100) — NOT NULL
  • related_keyword — VARCHAR(100) — NOT NULL

snap_comment

  • comment_id — INT — Primary key — NOT NULL
  • post_id — INT — Foreign key → snap_post.post_id — NOT NULL
  • user_id — INT — Foreign key → user.user_id — NOT NULL
  • content — VARCHAR(500) — NOT NULL
  • created_at — TIMESTAMP

snap_image

  • image_id — INT — Primary key — NOT NULL
  • post_id — INT — Foreign key → snap_post.post_id — NOT NULL
  • image_url — VARCHAR(255) — NOT NULL

snap_like

  • user_id — INT — Foreign key → user.user_id — NOT NULL
  • post_id — INT — Foreign key → snap_post.post_id — NOT NULL

snap_post

  • post_id — INT — Primary key — NOT NULL
  • user_id — INT — Foreign key → user.user_id — NOT NULL
  • content — TEXT
  • created_at — TIMESTAMP

snap_post_hashtag

  • post_id — INT — Foreign key → snap_post.post_id — NOT NULL
  • hashtag_id — INT — Foreign key → hashtag.hashtag_id — NOT NULL

snap_product_tag

  • tag_id — INT — Primary key — NOT NULL
  • post_id — INT — Foreign key → snap_post.post_id — NOT NULL
  • option_id — INT — Foreign key → product_option.option_id — NOT NULL

user

  • user_id — INT — Primary key — NOT NULL
  • username — VARCHAR(50) — NOT NULL
  • profile_img — VARCHAR(255)
  • user_tier — VARCHAR(20)