hw_3

Tables (7)

Category (Untitled3)

  • id_ca (카테고리 아이디) — BIGINT — Primary key — NOT NULL
  • name (카테고리 이름) — VARCHAR(20)

Comment (Untitled5)

  • id_cmt (코멘트 아이디) — BIGINT — Primary key — NOT NULL
  • id_post (게시물 아이디) — BIGINT — Foreign key → Post.id_post — NOT NULL
  • id (유저 아이디) — BIGINT — Foreign key → User.id — NOT NULL

Follow (Untitled7)

  • id_following, id_follower (팔로잉 아이디, 팔로워 아이디) — BIGINT, BIGINT — Primary key — NOT NULL
  • id_following (팔로잉 아이디) — BIGINT — Foreign key → User.id — NOT NULL
  • id_follower (팔로워 아이디) — BIGINT — Foreign key → User.id — NOT NULL

Like (Untitled6)

  • id, id_post (아이디, 게시물 아이디) — BIGINT, BIGINT — Primary key — NOT NULL
  • id_post (게시물 아이디) — BIGINT — Foreign key → Post.id_post — NOT NULL
  • id (유저 아이디) — BIGINT — Foreign key → User.id — NOT NULL

Post (Untitled2)

  • id_post (게시물 아이디) — BIGINT — Primary key — NOT NULL
  • id (유저 아이디) — BIGINT — Foreign key → User.id — NOT NULL
  • title (제목) — VARCHAR(50)
  • content (내용) — VARCHAR(5000)
  • view_cnt (조회수) — INT
  • like_cnt (좋아요수) — INT
  • cmt_cnt (댓글수) — INT

Post_Category (Untitled4)

  • id_ca, id_post (카테고리 아이디, 게시물 아이디) — BIGINT, BIGINT — Primary key — NOT NULL
  • id_ca (카테고리 아이디) — BIGINT — Foreign key → Category.id_ca — NOT NULL
  • id_post (게시물 아이디) — BIGINT — Foreign key → Post.id_post — NOT NULL

User (Untitled)

  • id (유저 아이디) — BIGINT — Primary key — NOT NULL
  • name (이름) — VARCHAR(10)
  • email (이메일) — VARCHAR(20)
  • phone (번호) — INT
  • password (비밀번호) — VARCHAR(20)