[Servlet / JSP] Mysql 13장 예제 쿼리문 적기

2011. 8. 9. 19:28개발관련기록/Servlet_JSP

반응형

create table message_board (
boardId  int  not  null  auto_increment,
groupId  int  not  null,
sequenceNo  char(20)  not  null,
registerDate   datetime  not  null,
referenceCount  int   not   null,
name   varchar(20)  not   null,
passwd   varchar(10),
title   varchar(100),
content    text,
primary key (boardId),
index (sequenceNo)
);
create table sequence_new_value (
sequence_name varchar(20) not null,
newGroupValue int not null,
primary key (sequence_name)
);

insert into sequence_new_value values ('newBoardGroupNo', 0);

create   table   imgfileinfo(
no    int   not    null   auto_increment,
boardId   int  not  null  ,
encodedFileName  text   not   null,
filePath    text  not   null,
saveFolder    varchar(45)  not  null,
systemFileName   text   not   null,
originalFileName   text  not   null,
originalImgFile   text,
thumbnailImgFile   text,
primary key (no) ,
  constraint fk_boardId foreign key( boardId )
     references message_board (`boardId`)
     on  delete  cascade
     on  update  cascade
);
 
반응형