데이터베이스 설계

use board_crud;

create table User (
	user_email varchar(50) primary key,
    user_password varchar(100) not null,
    user_nickname varchar(30) not null,
    user_phone_number varchar(15) not null,
    user_address text not null,
    user_profile text
);

create table board (
	board_number int primary key auto_increment,
    board_title varchar(200) not null,
    board_content text not null,
    board_image text,
    board_video text,
    board_file text,
    board_writer_email varchar(50) not null,
    board_write_profile text,
    board_write_nickname varchar(30) not null,
    board_write_date date not null,
    board_click_count int default 0,
    board_like_count int default 0,
    board_comment_count int default 0
);

create table PopularSearch (
	popular_term varchar(200) primary key,
    popular_search_count int default 1
);

create table Likes (
	like_id int auto_increment primary key,
	board_number int not null,
    user_email varchar(50) not null,
    like_user_profile text,
    like_user_nickname varchar(30) not null
);


create table Comment (
	comment_id int auto_increment primary key,
	board_number int not null,
    user_email varchar(50) not null,
    comment_user_profile text,
    comment_user_nickname varchar(30) not null,
    comment_write_date date not null,
    comment_content text not null
);

show tables;
profile
Backend Developer

0개의 댓글