<CREATE BOARD>
CREATE TABLE BOARD (
num INT(11) NOT NULL AUTO_INCREMENT,
writer VARCHAR(10) NOT NULL,
email VARCHAR(30) NULL DEFAULT NULL,
subject VARCHAR(50) NOT NULL,
passwd VARCHAR(12) NOT NULL,
reg_date DATETIME NOT NULL,
readcount INT(11) NULL DEFAULT '0',
ref INT(11) NOT NULL,
re_step SMALLINT(6) NOT NULL,
re_level SMALLINT(6) NOT NULL,
content TEXT NOT NULL,
ip VARCHAR(20) NOT NULL,
PRIMARY KEY (num)
)
<INSERT>
INSERT INTO BOARD VALUES((SELECT ifnull(MAX(num),0)+1 FROM BOARD b), '사나','sana@naver.com','사나없이 못사나','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO BOARD VALUES((SELECT ifnull(MAX(num),0)+1 FROM BOARD b), '나연','nayeon@naver.com','나연없이 못나연','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO BOARD VALUES((SELECT ifnull(MAX(num),0)+1 FROM BOARD b), '정연','jeongyeon@naver.com','정연없이 못정연','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO BOARD VALUES((SELECT ifnull(MAX(num),0)+1 FROM BOARD b), '모모','momo@naver.com','모모없이 못모모','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO BOARD VALUES((SELECT ifnull(MAX(num),0)+1 FROM BOARD b), '지효','jihyo@naver.com','지효없이 못지효','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO BOARD VALUES((SELECT ifnull(MAX(num),0)+1 FROM BOARD b), '미나','mina@naver.com','미나없이 못미나','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO BOARD VALUES((SELECT ifnull(MAX(num),0)+1 FROM BOARD b), '다현','dahyun@naver.com','다현없이 못다현','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO BOARD VALUES((SELECT ifnull(MAX(num),0)+1 FROM BOARD b), '채영','chaeyeong@naver.com','채영없이 못채영','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO BOARD VALUES((SELECT ifnull(MAX(num),0)+1 FROM BOARD b), '쯔위','tzuyu@naver.com','쯔위없이 못쯔위','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
<CREATE USER>
CREATE TABLE USER(
num INT(11) NOT NULL,
id VARCHAR(20) NOT NULL,
passwd VARCHAR(20) NOT NULL,
email VARCHAR(30) NOT NULL,
NAME VARCHAR(20) NOT NULL,
nick VARCHAR(20) NOT NULL,
reg_date DATETIME DEFAULT NOW(),
PRIMARY KEY(num));
<INSERT USER>
INSERT INTO USER(num,id,passwd,email,NAME,nick) VALUES((SELECT ifnull(MAX(num),0)+1 FROM USER u),'sana','1234','sana@gamil.com','사나','사나당');
INSERT INTO USER(num,id,passwd,email,NAME,nick) VALUES((SELECT ifnull(MAX(num),0)+1 FROM USER u),'nayeon','1234','nayeon@gamil.com','나연','나연당');
INSERT INTO USER(num,id,passwd,email,NAME,nick) VALUES((SELECT ifnull(MAX(num),0)+1 FROM USER u),'jeongyeon','1234','jeongyeon@gamil.com','정연','정연당');
INSERT INTO USER(num,id,passwd,email,NAME,nick) VALUES((SELECT ifnull(MAX(num),0)+1 FROM USER u),'momo','1234','momo@gamil.com','모모','모모당');
INSERT INTO USER(num,id,passwd,email,NAME,nick) VALUES((SELECT ifnull(MAX(num),0)+1 FROM USER u),'jihyo','1234','jihyo@gamil.com','지효','지효당');
INSERT INTO USER(num,id,passwd,email,NAME,nick) VALUES((SELECT ifnull(MAX(num),0)+1 FROM USER u),'mina','1234','mina@gamil.com','미나','미나당');
INSERT INTO USER(num,id,passwd,email,NAME,nick) VALUES((SELECT ifnull(MAX(num),0)+1 FROM USER u),'dahyun','1234','dahyun@gamil.com','다현','다현당');
INSERT INTO USER(num,id,passwd,email,NAME,nick) VALUES((SELECT ifnull(MAX(num),0)+1 FROM USER u),'chaeyeong','1234','chaeyeong@gamil.com','채영','채영당');
INSERT INTO USER(num,id,passwd,email,NAME,nick) VALUES((SELECT ifnull(MAX(num),0)+1 FROM USER u),'tzuyu','1234','tzuyu@gamil.com','쯔위','쯔위당');
<CREATE FUN>
CREATE TABLE FUN(
num INT(11) NOT NULL AUTO_INCREMENT,
writer VARCHAR(10) NOT NULL,
email VARCHAR(30) NULL DEFAULT NULL,
subject VARCHAR(50) NOT NULL,
passwd VARCHAR(12) NOT NULL,
reg_date DATETIME NOT NULL,
readcount INT(11) NULL DEFAULT '0',
ref INT(11) NOT NULL,
re_step SMALLINT(6) NOT NULL,
re_level SMALLINT(6) NOT NULL,
content TEXT NOT NULL,
ip VARCHAR(20) NOT NULL,
uploadfile1 VARCHAR(50),
uploadfile2 VARCHAR(50),
uploadfile3 VARCHAR(50),
PRIMARY KEY (num)
);
<INSERT FUN>
INSERT INTO FUN(num,writer,email,subject,passwd,reg_date,readcount,ref,re_step,re_level,content,ip) VALUES((SELECT ifnull(MAX(num),0)+1 FROM FUN f), '사나','sana@naver.com','사나없이 못사나','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO FUN(num,writer,email,subject,passwd,reg_date,readcount,ref,re_step,re_level,content,ip) VALUES((SELECT ifnull(MAX(num),0)+1 FROM FUN f), '나연','nayeon@naver.com','나연없이 못나연','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO FUN(num,writer,email,subject,passwd,reg_date,readcount,ref,re_step,re_level,content,ip) VALUES((SELECT ifnull(MAX(num),0)+1 FROM FUN f), '정연','jeongyeon@naver.com','정연없이 못정연','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO FUN(num,writer,email,subject,passwd,reg_date,readcount,ref,re_step,re_level,content,ip) VALUES((SELECT ifnull(MAX(num),0)+1 FROM FUN f), '모모','momo@naver.com','모모없이 못모모','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO FUN(num,writer,email,subject,passwd,reg_date,readcount,ref,re_step,re_level,content,ip) VALUES((SELECT ifnull(MAX(num),0)+1 FROM FUN f), '지효','jihyo@naver.com','지효없이 못지효','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO FUN(num,writer,email,subject,passwd,reg_date,readcount,ref,re_step,re_level,content,ip) VALUES((SELECT ifnull(MAX(num),0)+1 FROM FUN f), '미나','mina@naver.com','미나없이 못미나','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO FUN(num,writer,email,subject,passwd,reg_date,readcount,ref,re_step,re_level,content,ip) VALUES((SELECT ifnull(MAX(num),0)+1 FROM FUN f), '다현','dahyun@naver.com','다현없이 못다현','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO FUN(num,writer,email,subject,passwd,reg_date,readcount,ref,re_step,re_level,content,ip) VALUES((SELECT ifnull(MAX(num),0)+1 FROM FUN f), '채영','chaeyeong@naver.com','채영없이 못채영','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
INSERT INTO FUN(num,writer,email,subject,passwd,reg_date,readcount,ref,re_step,re_level,content,ip) VALUES((SELECT ifnull(MAX(num),0)+1 FROM FUN f), '쯔위','tzuyu@naver.com','쯔위없이 못쯔위','1234', NOW(),0,0,0,0,'안녕하세요','100.100.100.100');
'[프로젝트제작&정리] > 나무바다 제작' 카테고리의 다른 글
[나무바다] 자료실 코드 (0) | 2019.12.30 |
---|---|
[나무바다] 각 호스팅 폴더에 ROOT.war 파일을 배포해보자. (0) | 2019.12.23 |
[나무바다] 하나의 호스트에서 두개의 도메인(서브 도메인)을 사용하자 (0) | 2019.12.20 |
[나무바다] cafe24 외부 도메인 dns 설정 변경방법 (0) | 2019.12.19 |
[나무바다] Godday에 cafe24 네임 서버 등록하기 (0) | 2019.12.19 |