数据库建库utf-8,及级联删除

//建库设为UTF-8格式

CREATE DATABASE `test2` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;


//会级联删除的表
create table article(
articleid int PRIMARY KEY NOT NULL auto_increment,
columnsid int,
memberid int,
titlezh varchar(50),
contentzh text,
titleen varchar(50),
contenten text,
submittime varchar(50),
updatetime varchar(50),
contribution int,
ischeck int,
index(memberid),
FOREIGN KEY(memberid) REFERENCES member(memberid) ON DELETE CASCADE
)

你可能感兴趣的:(java)