본문 바로가기

program life

mysql Create Table 예제

CREATE TABLE board (


board_id int(20) unsigned NOT NULL AUTO_INCREMENT,

title varchar(255) NOT NULL,

content mediumtext,

member_id int(10) unsigned NOT NULL,

member_nick varchar(32) NOT NULL,

hit int(20) unsigned NOT NULL default '0',

create_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP

modify_date DATETIME NOT NULL ON UPDATE CURRENT_TIMESTAMP,

PRIMARY KEY (board_id)


);




자동증가

board_id bigint(20) unsigned NOT NULL AUTO_INCREMENT


생성일

create_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP


수정일

modify_date DATETIME NOT NULL ON UPDATE CURRENT_TIMESTAMP,