// DB생성
drop database if exists textBoard;
create database textBoard;
use textBoard;
// 게시물 테이블 생성
create table article (
id int(10) unsigned not null auto_increment,
regDate datetime not null,
updateDate datetime not null,
title char(200) not null,
`body` text not null,
memberId int(10) unsigned not null,
boardId int(10) unsigned not null
);
// 게시물 데이터 3개 생성
insert into article
set regDate = now(),
updatedDate = now(),
title = '제목1',
`body` = '내용1',
memberId = 1,
boardId = 1;
insert into article
set regDate = now(),
updatedDate = now(),
title = '제목2',
`body` = '내용2',
memberId = 2,
boardId = 2;
insert into article
set regDate = now(),
updatedDate = now(),
title = '제목3',
`body` = '내용3',
memberId = 3,
boardId = 3;
*전체적인 일상은 노션을 통해 작성하고 있습니다.
링크 : www.notion.so/025-3224dff388e649038676b4c6e3a4f07e
'SQL' 카테고리의 다른 글
#062 [과제4] 라이브러리가 무엇인지 이해 (0) | 2020.12.15 |
---|---|
#061 [과제3] 왜 JDBC만으로는 안되고 MySQL 드라이버가 필요한지 이해 (0) | 2020.12.15 |
#060 [과제2] MySQL 드라이버와 JDBC의 개념 이해 (0) | 2020.12.15 |
#059 [과제1] JDBC의 이해 (0) | 2020.12.15 |
#058 기사등록/연결생성/쿼리실행 (0) | 2020.12.14 |