博客系统开发推送第二季----数据库设计
2017-05-17 17:02
543 查看
# 数据库名 :blog
六张表:博客blog,用户user,博文分类category,博文article,评论review,相册picture
# 具体创建数据库脚本
article表
blog表
user表
category表
review表
picture表
接下来,就根据该数据库设计,编写实现该博客系统的功能!
六张表:博客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 );
category表
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 );
review表
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) );
picture表
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 );
接下来,就根据该数据库设计,编写实现该博客系统的功能!
相关文章推荐
- 用三层架构与设计模式思想部署企业级数据库业务系统开发
- 一份博客系统数据库设计字典(菜鸟级别)
- [置顶]信息发布系统 Jquery+MVC架构开发(2) 在EA下进行数据库设计
- C#人事管理系统开发(2)数据库设计
- 黑马程序员之项目开发学习笔记:ATM取款机系统数据库设计
- 用三层架构与设计模式思想部署企业级数据库业务系统开发
- AgileEAS.NET平台开发实例-药店系统-数据库设计
- Oracle平台应用数据库系统的设计与开发
- 用三层架构与设计模式思想部署企业级数据库业务系统开发
- 开发高效的Tag标签系统数据库设计
- 用三层架构与设计模式思想部署企业级数据库业务系统开发(转)
- (转)用三层架构与设计模式思想部署企业级数据库业务系统开发
- 用三层架构与设计模式思想部署企业级数据库业务系统开发
- 信息发布系统 Jquery+MVC架构开发(2) 在EA下进行数据库设计
- Oracle平台应用数据库系统的设计与开发
- 一份博客系统数据库设计字典(菜鸟级别)
- 用三层架构与设计模式思想部署企业级数据库业务系统开发
- 用三层架构与设计模式思想部署企业级数据库业务系统开发
- 微博系统开发数据库设计参考(二)