数据库设计,我这里用的PowerDesigner 15(破解版),需要下载的朋友可以去电驴搜索一下.
我这里只是简单设计了一下,也没有什么深入考虑,毕竟整个项目就比较简单 也不是什么正规的.
上图一个:
 
PD设计好了以后,Ctrl+G生成脚本文件:

drop table if exists tbBookAuthor;drop table if exists tbBookCategory;drop table if exists tbBookInfo;drop table if exists tbBookPublisher;drop table if exists tbManagerInfo;drop table if exists tbOrderInfo;drop table if exists tbOrderItem;drop table if exists tbStoreInfo;drop table if exists tbUserAddress;drop table if exists tbUserInfo;drop table if exists tbrBookAuthor;/*==============================================================*/
/* Table: tbBookAuthor                                          */
/*==============================================================*/
create table tbBookAuthor
(author_id            int not null auto_increment,author_name          varchar(64) not null,author_info          text,author_memo          text,primary key (author_id)
);alter table tbBookAuthor comment '图书作者信息表';/*==============================================================*/
/* Table: tbBookCategory                                        */
/*==============================================================*/
create table tbBookCategory
(category_id          int not null auto_increment,category_name        varchar(32) not null,category_description text,category_memo        text,primary key (category_id)
);alter table tbBookCategory comment '图书分类表';/*==============================================================*/
/* Table: tbBookInfo                                            */
/*==============================================================*/
create table tbBookInfo
(book_id              int not null auto_increment,category_id          int,publisher_id         int,book_name            varchar(64) not null,book_price           float,book_description     text,book_memo            text,book_nowprice        float,book_storeno         int,primary key (book_id)
);alter table tbBookInfo comment '图书信息表';/*==============================================================*/
/* Table: tbBookPublisher                                       */
/*==============================================================*/
create table tbBookPublisher
(publisher_id         int not null auto_increment,publisher_name       varchar(32) not null,publisher_addr       varchar(64),publisher_phone      varchar(18),publisher_email      varchar(32),publisher_url        varchar(64),publisher_description text,publisher_memo       text,primary key (publisher_id)
);alter table tbBookPublisher comment '图书出版商信息表';/*==============================================================*/
/* Table: tbManagerInfo                                         */
/*==============================================================*/
create table tbManagerInfo
(manager_id           int not null auto_increment,manager_name         varchar(32) not null,manager_password     varchar(32) not null,primary key (manager_id)
);alter table tbManagerInfo comment '书店管理员信息表';/*==============================================================*/
/* Table: tbOrderInfo                                           */
/*==============================================================*/
create table tbOrderInfo
(order_id             int not null auto_increment,addr_id              int,order_tel            varchar(18) not null,order_time           datetime,order_memo           text,primary key (order_id)
);alter table tbOrderInfo comment '订单信息表';/*==============================================================*/
/* Table: tbOrderItem                                           */
/*==============================================================*/
create table tbOrderItem
(item_id              int not null auto_increment,order_id             int,book_id              int,item_number          int,item_memo            text,primary key (item_id)
);alter table tbOrderItem comment '订单中每一项信息表';/*==============================================================*/
/* Table: tbStoreInfo                                           */
/*==============================================================*/
create table tbStoreInfo
(store_name           varchar(32) not null,store_addr           varchar(64),store_phone          varchar(18),store_email          varchar(64),store_descriptrion   text,store_memo           text,primary key (store_name)
);alter table tbStoreInfo comment '书店基础信息表,包含书店的名字,地址,电话等信息';/*==============================================================*/
/* Table: tbUserAddress                                         */
/*==============================================================*/
create table tbUserAddress
(addr_id              int not null auto_increment,user_id              int,addr_addr            varchar(64) not null,addr_memo            text,primary key (addr_id)
);alter table tbUserAddress comment '用户的收货地址';/*==============================================================*/
/* Table: tbUserInfo                                            */
/*==============================================================*/
create table tbUserInfo
(user_id              int not null auto_increment,user_name            varchar(32) not null,user_password        varchar(32) not null,user_email           varchar(64),user_phone           varchar(18),user_description     text,user_memo            text,primary key (user_id)
);alter table tbUserInfo comment '用户表';/*==============================================================*/
/* Table: tbrBookAuthor                                         */
/*==============================================================*/
create table tbrBookAuthor
(rba_ID               int not null auto_increment,book_id              int,author_id            int,primary key (rba_ID)
);alter table tbrBookAuthor comment '图书和作者关系表,多对多';alter table tbBookInfo add constraint FK_BookCategory foreign key (category_id)references tbBookCategory (category_id) on delete set null on update cascade;alter table tbBookInfo add constraint FK_BookPublisher foreign key (publisher_id)references tbBookPublisher (publisher_id) on delete set null on update cascade;alter table tbOrderInfo add constraint FK_OrderAddress foreign key (addr_id)references tbUserAddress (addr_id) on update cascade;alter table tbOrderItem add constraint FK_BookOrder foreign key (book_id)references tbBookInfo (book_id) on update cascade;alter table tbOrderItem add constraint FK_OrderItem foreign key (order_id)references tbOrderInfo (order_id) on update cascade;alter table tbUserAddress add constraint FK_UserAddress foreign key (user_id)references tbUserInfo (user_id) on delete cascade on update cascade;alter table tbrBookAuthor add constraint FK_rAuthor foreign key (author_id)references tbBookAuthor (author_id) on delete cascade on update cascade;alter table tbrBookAuthor add constraint FK_rBook foreign key (book_id)references tbBookInfo (book_id) on delete restrict on update cascade;

整个文件的下载地址

转载于:https://www.cnblogs.com/huangjacky/archive/2010/05/12/1733585.html

Java - 自己动手之在线书店(2)相关推荐

  1. Java、JSP等在线书店

    随着网络的发展,网上书店越来越受人们的关注.通过网上书店,人们在家里就可以买到自己想要的图书.网上书店以公司实际的需求为基础,使用了动态网站技术. 从长期的战略目标来说,图书在线销售网站不仅是图书和服 ...

  2. Java、JSP在线书店的设计

    技术:Java.JSP等 摘要: 1. 绪论    1 1.1目的意义    1 1.2国内外研究现状    1 1.3概念内涵    2 1.3.1IT    2 1.3.2在线书店    3 1. ...

  3. java计算机毕业设计基于MVC框架的在线书店设计源码+数据库+系统+lw文档+mybatis+运行部署

    java计算机毕业设计基于MVC框架的在线书店设计源码+数据库+系统+lw文档+mybatis+运行部署 java计算机毕业设计基于MVC框架的在线书店设计源码+数据库+系统+lw文档+mybatis ...

  4. java计算机毕业设计课程在线反馈系统源代码+数据库+系统+lw文档

    java计算机毕业设计课程在线反馈系统源代码+数据库+系统+lw文档 java计算机毕业设计课程在线反馈系统源代码+数据库+系统+lw文档 本源码技术栈: 项目架构:B/S架构 开发语言:Java语言 ...

  5. java毕业生设计星光在线光影系统计算机源码+系统+mysql+调试部署+lw

    java毕业生设计星光在线光影系统计算机源码+系统+mysql+调试部署+lw java毕业生设计星光在线光影系统计算机源码+系统+mysql+调试部署+lw 本源码技术栈: 项目架构:B/S架构 开 ...

  6. java毕业设计OTET交通在线查询购票系统Mybatis+系统+数据库+调试部署

    java毕业设计OTET交通在线查询购票系统Mybatis+系统+数据库+调试部署 java毕业设计OTET交通在线查询购票系统Mybatis+系统+数据库+调试部署 本源码技术栈: 项目架构:B/S ...

  7. java毕业设计美容中心在线后台管理系统源码+lw文档+mybatis+系统+mysql数据库+调试

    java毕业设计美容中心在线后台管理系统源码+lw文档+mybatis+系统+mysql数据库+调试 java毕业设计美容中心在线后台管理系统源码+lw文档+mybatis+系统+mysql数据库+调 ...

  8. java毕业设计乐勤网书店源码+lw文档+mybatis+系统+mysql数据库+调试

    java毕业设计乐勤网书店源码+lw文档+mybatis+系统+mysql数据库+调试 java毕业设计乐勤网书店源码+lw文档+mybatis+系统+mysql数据库+调试 本源码技术栈: 项目架构 ...

  9. 基于JSP的在线书店的设计

    技术:Java.JSP等 摘要: 电子商务是近十年来崛起的一种新兴商业模式,其基于现在的互联网技术,顺应互联网+的时代潮流,影响力越来越大,已经渗透进人们的日常,快速成长为一种新的商业模式.这种商业模 ...

最新文章

  1. vhosetuser 和 vhostuservlient 差异
  2. 优秀的程序员是那种过单行线马路都要往两边看的人
  3. JavaEE实战班第十天
  4. Spring 事务初始化源码分析
  5. 乐播投延迟很高_定投基金有变化
  6. PATH、cp命令、mv、文档查看命令
  7. Collat​​e SQL命令概述
  8. java 访问权限控制
  9. 拯救者Y7000在ubuntu下的1660Ti驱动安装
  10. 微信壁纸头像小程序(附源码)
  11. EXCEL,如何根据数据选择合适的图表?
  12. 解决IPOD NANO7无法开机
  13. dnf连接服务器黑屏xp系统,windows xp进入桌面后黑屏的解决技巧
  14. python头像教程_微信好友头像全家福详细教程python版
  15. QT笔记——Q_Q 和Q_D 学习
  16. TSL 传输层安全性协议
  17. NTC热敏电阻基础以及应用和选择(转)
  18. 数学建模:预测性模型学习——灰色预测模型(GM(1,1)模型)
  19. Unicode以及字符集转换
  20. 2020年度 个人随笔

热门文章

  1. C、C++ 宽字符WCString转为char*
  2. 设计模式笔记之七 (桥接模式)
  3. 除非得到你的首肯,否则别人无法伤害你——Leo网上答疑(20)
  4. 数据加密类型及创建和申请CA证书
  5. 【转】程序员健康建议
  6. android 对for循环进行优化
  7. Android JNI_OnLoad()函数
  8. Dalvik线程模型
  9. 获取GitHub上远程分支内容
  10. onnx模型推理(python)