# 数据库名 :blog
六张表:博客blog,用户user,博文分类category,博文article,评论review,相册picture
# 具体创建数据库脚本
article表
create table article ( article_id int(10) auto_increment primary key, category_id int not null references category(category_id), article_title varchar(200) not null, article_date date , article_content text , article_summary text not null, article_acessNum int not null default 0, article_reviewNum int not null default 0 )
blog表
create table blog( blog_id INT AUTO_INCREMENT PRIMARY KEY, blog_title varchar(50) not null, blog_logo varchar(50) not null );user表
create table user( user_id INT AUTO_INCREMENT PRIMARY KEY, blog_id int unique references blog(blog_id), user_name varchar(30) not null, user_pwd varchar(20) not null, user_sex varchar(2) not null, user_email varchar(50) not null, user_picture BLOB, user_basicInfo text );
create table category( category_id INT AUTO_INCREMENT PRIMARY KEY, blog_id int not null references blog(blog_id), category_title varchar(50) not null );
create table review( review_id INT AUTO_INCREMENT PRIMARY KEY, article_id int not null references article(article_id), review_content text not null, review_datetime timestamp not null, user_id int not null references user(user_id) );
create table picture( picture_id INT AUTO_INCREMENT PRIMARY KEY, blog_id int not null references blog(blog_id), picture_title varchar(50) not null, picture_profile varchar(200) not null, picture_accessNum int not null default 0 );