From d696789ce3b3deb02fb477a74aec6b9d4bb23ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E5=8A=9F=E7=85=A7?= <3210416196@qq.com> Date: Thu, 12 Sep 2024 23:11:12 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...256\241\347\275\221\345\272\227\345\233\276\344\271\246.md" | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 "\345\217\266\345\212\237\347\205\247/20240912 \345\210\235\350\256\276\350\256\241\347\275\221\345\272\227\345\233\276\344\271\246.md" diff --git "a/\345\217\266\345\212\237\347\205\247/20240912 \345\210\235\350\256\276\350\256\241\347\275\221\345\272\227\345\233\276\344\271\246.md" "b/\345\217\266\345\212\237\347\205\247/20240912 \345\210\235\350\256\276\350\256\241\347\275\221\345\272\227\345\233\276\344\271\246.md" new file mode 100644 index 0000000..dad9810 --- /dev/null +++ "b/\345\217\266\345\212\237\347\205\247/20240912 \345\210\235\350\256\276\350\256\241\347\275\221\345\272\227\345\233\276\344\271\246.md" @@ -0,0 +1,3 @@ +# 设计图 + +- ![image-20240912230239413](https://gitee.com/ygzdegitee/img/raw/master/imgs/202409122302516.png) \ No newline at end of file -- Gitee From e765f847846864e1913de1c4c59b4e326a140faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E5=8A=9F=E7=85=A7?= <3210416196@qq.com> Date: Fri, 13 Sep 2024 22:30:06 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...5\221\345\272\227\345\233\276\344\271\246.md" | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git "a/\345\217\266\345\212\237\347\205\247/20240912 \345\210\235\350\256\276\350\256\241\347\275\221\345\272\227\345\233\276\344\271\246.md" "b/\345\217\266\345\212\237\347\205\247/20240912 \345\210\235\350\256\276\350\256\241\347\275\221\345\272\227\345\233\276\344\271\246.md" index dad9810..52cf8a8 100644 --- "a/\345\217\266\345\212\237\347\205\247/20240912 \345\210\235\350\256\276\350\256\241\347\275\221\345\272\227\345\233\276\344\271\246.md" +++ "b/\345\217\266\345\212\237\347\205\247/20240912 \345\210\235\350\256\276\350\256\241\347\275\221\345\272\227\345\233\276\344\271\246.md" @@ -1,3 +1,17 @@ # 设计图 -- ![image-20240912230239413](https://gitee.com/ygzdegitee/img/raw/master/imgs/202409122302516.png) \ No newline at end of file +- ![image-20240912230239413](https://gitee.com/ygzdegitee/img/raw/master/imgs/202409122302516.png) + +# 三大模型 + +- CDM + +![image-20240913190942201](https://gitee.com/ygzdegitee/img/raw/master/imgs/202409131909399.png) + +- LDM + +![image-20240913191017751](https://gitee.com/ygzdegitee/img/raw/master/imgs/202409131910882.png) + +- PDM + +![image-20240913191031907](https://gitee.com/ygzdegitee/img/raw/master/imgs/202409131910014.png) \ No newline at end of file -- Gitee From 1ba0340e0bfb661a26fa92de87d79ffd3eda3101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E5=8A=9F=E7=85=A7?= <3210416196@qq.com> Date: Sat, 14 Sep 2024 11:43:54 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\241\347\275\221\345\272\227\345\233\276\344\271\246.md" | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git "a/\345\217\266\345\212\237\347\205\247/20240912 \345\210\235\350\256\276\350\256\241\347\275\221\345\272\227\345\233\276\344\271\246.md" "b/\345\217\266\345\212\237\347\205\247/20240912 \345\210\235\350\256\276\350\256\241\347\275\221\345\272\227\345\233\276\344\271\246.md" index 52cf8a8..f541851 100644 --- "a/\345\217\266\345\212\237\347\205\247/20240912 \345\210\235\350\256\276\350\256\241\347\275\221\345\272\227\345\233\276\344\271\246.md" +++ "b/\345\217\266\345\212\237\347\205\247/20240912 \345\210\235\350\256\276\350\256\241\347\275\221\345\272\227\345\233\276\344\271\246.md" @@ -6,12 +6,12 @@ - CDM -![image-20240913190942201](https://gitee.com/ygzdegitee/img/raw/master/imgs/202409131909399.png) +![image-20240914100524904](https://gitee.com/ygzdegitee/img/raw/master/imgs01/upgit_20240914_1726279525.png) - LDM -![image-20240913191017751](https://gitee.com/ygzdegitee/img/raw/master/imgs/202409131910882.png) + ![image-20240914100557263](https://gitee.com/ygzdegitee/img/raw/master/imgs01/upgit_20240914_1726279557.png) - PDM -![image-20240913191031907](https://gitee.com/ygzdegitee/img/raw/master/imgs/202409131910014.png) \ No newline at end of file +![image-20240914100505388](https://gitee.com/ygzdegitee/img/raw/master/imgs01/upgit_20240914_1726279505.png) \ No newline at end of file -- Gitee From 11fc74b8158c850ca98567d2b63f1b89a7318d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E5=8A=9F=E7=85=A7?= <3210416196@qq.com> Date: Sat, 14 Sep 2024 16:44:50 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...21\344\270\212\344\271\246\345\272\227.md" | 591 ++++++++++++++++++ 1 file changed, 591 insertions(+) create mode 100644 "\345\217\266\345\212\237\347\205\247/20240914 \347\275\221\344\270\212\344\271\246\345\272\227.md" diff --git "a/\345\217\266\345\212\237\347\205\247/20240914 \347\275\221\344\270\212\344\271\246\345\272\227.md" "b/\345\217\266\345\212\237\347\205\247/20240914 \347\275\221\344\270\212\344\271\246\345\272\227.md" new file mode 100644 index 0000000..568108c --- /dev/null +++ "b/\345\217\266\345\212\237\347\205\247/20240914 \347\275\221\344\270\212\344\271\246\345\272\227.md" @@ -0,0 +1,591 @@ +# ***建立数据库前猜想表*** + +1. ## 分类表 + +2. ## 图书表 + +3. ## 作者表 + +4. ## 角色表 + +5. ## 权限表 + +6. ## 用户表 + +7. ## 订单表 + +8. ## 用户地址表 + +9. ## 作者地址表 + +10. ## 出版社地址表 + +11. ## 订单地址表 + +12. ## 材质表 + +13. ## 销量表 + +14. ## 出版社表 + +15. ## 图片表 + +16. ## 状态表 + +| 分类 | | +| :------: | -------- | +| 分类编号 | 分类名称 | +| 1 | 艺术 | +| 2 | 历史 | +| 3 | 科幻 | +| 4 | 文学 | +| 5 | 科普 | + +| 图书 | | | | | | | | | | +| -------- | ---------------- | ------ | ---------------- | ---------- | ---- | ---------- | ---- | ------------------ | -------- | +| 图书编号 | 图书名称 | 作者 | 出版社 | 出版日期 | 封面 | 条形码编号 | 价格 | 图书内容 | 图书材质 | +| 1 | 《艺术是什么》 | 小飞飞 | 遨游世界出版社 | 2020/4/25 | A | 10101010 | 29.9 | 艺术的起源 | 牛皮纸 | +| 2 | 《唐代的发展史》 | 韦大力 | 遨游世界出版社 | 2020/5/26 | B | 10101111 | 19.9 | 唐朝的兴盛于衰败 | 白卡纸 | +| 3 | 《黑洞的形成》 | 卢比比 | 遨游世界出版社 | 2020/6/27 | C | 10102310 | 15.0 | 黑洞的形成原因 | 双胶纸 | +| 4 | 《论语》 | 吴甲甲 | 动物总动园出版社 | 2020/8/28 | D | 10184500 | 25.5 | 中国古代文学的美 | 牛皮纸 | +| 5 | 《自救小知识》 | 王璇璇 | 动物总动园出版社 | 2020/12/29 | E | 10146500 | 8.6 | 如何自救和救助他人 | 玻璃纸 | + +| 作者 | | | | | +| -------- | -------- | ---- | ---- | -------------------------- | +| 作者编号 | 作者名称 | 性别 | 年龄 | 简介 | +| 1 | 小飞飞 | 男 | 25 | 荣获省级文学比赛一等奖 | +| 2 | 韦大力 | 女 | 30 | 认为是新一代的文学大师 | +| 3 | 卢比比 | 女 | 50 | 荣获国家级文学比赛二等奖 | +| 4 | 吴甲甲 | 男 | 44 | 被评为最佳作者 | +| 5 | 王璇璇 | 男 | 66 | 斩获2050年度写实派最佳作者 | + +| 角色 | | +| -------- | -------- | +| 角色编号 | 角色名称 | +| 1 | 普通用户 | +| 2 | 高级用户 | +| 3 | 管理员 | + +| 权限 | | +| -------- | -------- | +| 权限编号 | 权限名称 | +| 1 | 购买 | +| 2 | 预定 | +| 3 | 新增 | +| 4 | 修改 | + +| 用户 | | +| -------- | -------- | +| 用户编号 | 用户名称 | +| 1 | 大嘴 | +| 2 | 刘能 | +| 3 | 赵四 | + +| 订单 | | | | | +| -------- | ------ | -------- | -------------- | -------------- | +| 订单编号 | 订单人 | 订单数量 | 订单地址 | 订单图书 | +| 1 | 刘能 | 5 | xxxxxxx | 《黑洞的形成》 | +| 2 | 赵四 | 1 | xxxxxxxxxxxx | 《自救小知识》 | +| 3 | 大嘴 | 8 | xxxxxxxxxxxxxx | 《论语》 | + +| 用户地址 | | | | | +| -------- | ------ | ------ | ------ | ----------- | +| 地址编号 | 省份 | 市 | 县/区 | 详细地址 | +| 1 | 福建省 | 三明市 | 福鼎县 | 福鼎路388号 | +| 2 | 江西省 | 新余市 | 渝水区 | 解放路981号 | +| 3 | 广东省 | 汕尾市 | 海丰县 | 红长路12号 | + +| 作者地址 | | | | | +| -------- | ------ | ------ | ------ | ----------- | +| 地址编号 | 省份 | 市 | 县/区 | 详细地址 | +| 1 | 福建省 | 三明市 | 福鼎县 | 福鼎路388号 | +| 2 | 江西省 | 新余市 | 渝水区 | 解放路981号 | +| 3 | 广东省 | 汕尾市 | 海丰县 | 红长路12号 | + +| 出版社地址 | | | | | +| ---------- | ------ | ------ | ------ | ----------- | +| 地址编号 | 省份 | 市 | 县/区 | 详细地址 | +| 1 | 福建省 | 三明市 | 福鼎县 | 福鼎路388号 | +| 2 | 江西省 | 新余市 | 渝水区 | 解放路981号 | +| 3 | 广东省 | 汕尾市 | 海丰县 | 红长路12号 | + +| 订单地址 | | | | | +| -------- | ------ | ------ | ------ | ----------- | +| 地址编号 | 省份 | 市 | 县/区 | 详细地址 | +| 1 | 福建省 | 三明市 | 福鼎县 | 福鼎路388号 | +| 2 | 江西省 | 新余市 | 渝水区 | 解放路981号 | +| 3 | 广东省 | 汕尾市 | 海丰县 | 红长路12号 | + +| 材质 | | +| -------- | -------- | +| 材质编号 | 材质名称 | +| 1 | 牛皮纸 | +| 2 | 双胶纸 | +| 3 | 玻璃纸 | + +| 销量 | | | | | +| -------- | ---------------- | -------- | ------ | -------- | +| 销量编号 | 图书名称 | 资料信息 | 月销量 | 年度销量 | +| 1 | 《艺术是什么》 | | 20 | 200 | +| 2 | 《黑洞的形成》 | | 10 | 150 | +| 3 | 《论语》 | | 15 | 80 | +| 4 | 《自救小知识》 | | 40 | 400 | +| 5 | 《唐代的发展史》 | | 5 | 50 | + +| 出版社 | | +| ------ | ---------------- | +| 编号 | 名称 | +| 1 | 遨游世界出版社 | +| 2 | 夕阳红出版社 | +| 3 | 动物总动园出版社 | + +| 图片 | | | | | +| -------- | -------- | -------- | ----------------- | --------- | +| 图片编号 | 图片名称 | 图片路径 | 上传者(用户/作者) | 上传时间 | +| 1 | 001.jpg | | | 2024/9/6 | +| 2 | 002.jpg | | | 2024/9/7 | +| 3 | 003.jpg | | | 2024/9/8 | +| 4 | 004.jpg | | | 2024/9/9 | +| 5 | 005.jpg | | | 2024/9/10 | + +# 建立三大模型 + +- ## CDM + + - ![image-20240914162513386](https://gitee.com/ygzdegitee/img/raw/master/imgs/202409141625596.png) + +- ## LDM + + - ![image-20240914162534862](https://gitee.com/ygzdegitee/img/raw/master/imgs/202409141625008.png) + +- ## PDM + + - ![image-20240914162548682](https://gitee.com/ygzdegitee/img/raw/master/imgs/202409141625844.png) + +# 数据库SQL + +```sql +/*==============================================================*/ +/* DBMS name: MySQL 5.0 */ +/* Created on: 2024/9/13 17:12:09 */ +/*==============================================================*/ + +#建数据库 + +drop database if exists book_shop; + +create database if not exists book_shop CHARSET utf8; + +use book_shop; + +drop table if exists address; + +drop table if exists author; + +drop table if exists book; + +drop table if exists book_indent; + +drop table if exists classify; + +drop table if exists indent; + +drop table if exists jur; + +drop table if exists jur_role; + +drop table if exists picture; + +drop table if exists press; + +drop table if exists role; + +drop table if exists statue; + +drop table if exists texture; + +drop table if exists user; + +drop table if exists volume; + +/*==============================================================*/ +/* Table: user_address */ +/*==============================================================*/ +create table user_address +( + ad_id int not null auto_increment, + u_id int, + province varchar(50), + city varchar(50), + detail_address varchar(255), + primary key (ad_id) +); + +/*==============================================================*/ +/* Table: press_address */ +/*==============================================================*/ +create table press_address +( + ad_id int not null auto_increment, + pid int, + province varchar(50), + city varchar(50), + detail_address varchar(255), + primary key (ad_id) +); + +/*==============================================================*/ +/* Table: indent_address */ +/*==============================================================*/ +create table indent_address +( + ad_id int not null auto_increment, + i_id int, + province varchar(50), + city varchar(50), + detail_address varchar(255), + primary key (ad_id) +); + +/*==============================================================*/ +/* Table: author_address */ +/*==============================================================*/ +create table author_address +( + ad_id int not null auto_increment, + a_id int, + province varchar(50), + city varchar(50), + detail_address varchar(255), + primary key (ad_id) +); + +/*==============================================================*/ +/* Table: author */ +/*==============================================================*/ +create table author +( + a_id int not null auto_increment, + p_id int not null, + a_name varchar(255), + sex varchar(10), + age int, + primary key (a_id) +); + +/*==============================================================*/ +/* Table: book */ +/*==============================================================*/ +create table book +( + b_id int not null auto_increment, + c_id int not null, + pid int not null, + tid int not null, + p_id int not null, + v_id int not null, + s_id int not null, + b_name varchar(25), + author varchar(50), + p_time date, + code bigint, + price float, + b_content varchar(255), + primary key (b_id) +); + +/*==============================================================*/ +/* Table: book_indent */ +/*==============================================================*/ +create table book_indent +( + i_id int not null, + b_id int not null, + primary key (i_id, b_id) +); + +/*==============================================================*/ +/* Table: classify */ +/*==============================================================*/ +create table classify +( + c_id int not null auto_increment, + c_name varchar(50), + primary key (c_id) +); + +/*==============================================================*/ +/* Table: indent */ +/*==============================================================*/ +create table indent +( + i_id int not null auto_increment, + i_name varchar(50), + i_num bigint, + i_book varchar(255), + primary key (i_id) +); + +/*==============================================================*/ +/* Table: jur */ +/*==============================================================*/ +create table jur +( + jur_id int not null auto_increment, + jur_name varchar(25), + primary key (jur_id) +); + +/*==============================================================*/ +/* Table: jur_role */ +/*==============================================================*/ +create table jur_role +( + r_id int not null, + jur_id int not null, + primary key (r_id, jur_id) +); + +/*==============================================================*/ +/* Table: picture */ +/*==============================================================*/ +create table picture +( + p_id int not null auto_increment, + u_id int not null, + p_name longblob, + p_path varchar(255), + push_name varchar(50), + push_time date, + primary key (p_id) +); + +/*==============================================================*/ +/* Table: press */ +/*==============================================================*/ +create table press +( + pid int not null auto_increment, + pname varchar(50), + p_phone varchar(20), + p_email varchar(50), + primary key (pid) +); + +/*==============================================================*/ +/* Table: role */ +/*==============================================================*/ +create table role +( + r_id int not null auto_increment, + r_name varchar(20), + primary key (r_id) +); + +/*==============================================================*/ +/* Table: statue */ +/*==============================================================*/ +create table statue +( + s_id int not null auto_increment, + s_name varchar(10), + primary key (s_id) +); + +/*==============================================================*/ +/* Table: texture */ +/*==============================================================*/ +create table texture +( + tid int not null auto_increment, + tname varchar(50), + primary key (tid) +); + +/*==============================================================*/ +/* Table: user */ +/*==============================================================*/ +create table user +( + u_id int not null auto_increment, + r_id int not null, + u_name varchar(255), + u_password varchar(255), + u_phone varchar(20), + u_email varchar(50), + balance float, + primary key (u_id) +); + +/*==============================================================*/ +/* Table: volume */ +/*==============================================================*/ +create table volume +( + v_id int not null auto_increment, + v_month bigint, + v_year bigint, + primary key (v_id) +); + +alter table author_address add constraint FK_addrss_press foreign key (a_id) + references author(a_id) on delete restrict on update restrict; + +alter table press_address add constraint FK_press_address foreign key(pid) + references press(p_id) on delete restrict on update restrict; + +alter table indent_address add constraint FK_indent_address foreign key(i_id) + references indent(i_id) on delete restrict on update restrict; + +alter table user_address add constraint FK_user_address foreign key (u_id) + references user (u_id) on delete restrict on update restrict; + +alter table author add constraint FK_author_address foreign key (ad_id) + references address (ad_id) on delete restrict on update restrict; + +alter table author add constraint FK_author_picture foreign key (p_id) + references picture (p_id) on delete restrict on update restrict; + +alter table book add constraint FK_book_cover foreign key (p_id) + references picture (p_id) on delete restrict on update restrict; + +alter table book add constraint FK_book_statue foreign key (s_id) + references statue (s_id) on delete restrict on update restrict; + +alter table book add constraint FK_book_volume foreign key (v_id) + references volume (v_id) on delete restrict on update restrict; + +alter table book add constraint FK_classify_book foreign key (c_id) + references classify (c_id) on delete restrict on update restrict; + +alter table book add constraint FK_press_book foreign key (pid) + references press (pid) on delete restrict on update restrict; + +alter table book add constraint FK_texture_book foreign key (tid) + references texture (tid) on delete restrict on update restrict; + +alter table book_indent add constraint FK_book_indent foreign key (i_id) + references indent (i_id) on delete restrict on update restrict; + +alter table book_indent add constraint FK_book_indent2 foreign key (b_id) + references book (b_id) on delete restrict on update restrict; + +alter table jur_role add constraint FK_jur_role foreign key (r_id) + references role (r_id) on delete restrict on update restrict; + +alter table jur_role add constraint FK_jur_role2 foreign key (jur_id) + references jur (jur_id) on delete restrict on update restrict; + +alter table picture add constraint FK_picture_user foreign key (u_id) + references user (u_id) on delete restrict on update restrict; + +alter table user add constraint FK_role_user foreign key (r_id) + references role (r_id) on delete restrict on update restrict; + +alter table indent add ad_id int; + +alter table indent add constraint FK_role_indent foreign key (ad_id) + references address(ad_id); + +#给分类表添加数据 + +insert into classify VALUES +(1,'艺术'),(2,'历史'),(3,'科幻'),(4,'文学'),(5,'科普'); + +#给状态表添加数据 + +insert into statue VALUES +(1,'上架'),(2,'下架'); + +#给销量表添加数据 + +insert into volume VALUES +(1,15,80),(2,5,30),(3,20,100),(4,1,10),(5,15,200); + +#给材质表添加数据 + +insert into texture VALUES +(1,'牛皮纸'),(2,'玻璃纸'),(3,'双胶纸'); + +#给角色表添加数据 + +insert into role VALUES +(1,'普通用户'),(2,'高级用户'),(3,'管理者'); + +#给权限表添加数据 + +insert into jur VALUES +(1,'购买'),(2,'预定'),(3,'新增'),(4,'修改'); + +#给出版社表添加数据 + +insert into press VALUES +(1,'遨游世界出版社','091-10086','ao@aysj.com'),(2,'夕阳红出版社 +','091-11010','xiyanghong@qq.com'),(3,'动物总动园出版社 +','091-22452','animal@qq.com'); + +#给权限角色表添加数据 + +insert into jur_role VALUES +(1,1),(2,1),(2,2),(3,3),(3,4); + +#给用户表添加数据 + +insert into `user` VALUES +(1,1,'刘能','liuneng666','15154892568','liu@qq.com',50),(2,2,'赵四','zhaosi000','18846465250','zhao@qq.com',100),(3,3,'大嘴','dazui123456','13325610256','zui@qq.com',0); + +#给出版社地址编添加数据 + +insert into press_address VALUES +(1,1,'福建省','宁德市','解放路75号'),(2,3,'广西省','柳州市','改革路225号'),(3,2,'江西省','赣州市','赣南路15号'); + +#给用户地址添加数据 + +insert into user_address VALUES +(1,1,'吉林省','吉林市','解放路10号'),(2,2,'黑龙江省','漠河市','改革路100号'),(3,3,'福建省','厦门市','繁华街1号'); + +#给照片表添加数据 + +insert into picture VALUES +(1,1,'001.jpg','C:\Users\Administrator\Desktop\img','一个人的寂寞','2004-03-30'),(2,1,'002.jpg','C:\Users\Administrator\Desktop\img','一个人','2004-05-10'),(3,2,'001.jpg','C:\Users\Administrator\Desktop\img','烟火','2006-03-30'); + +#给作者地址表添加数据 + +insert into author_address VALUES +(1,1,'江西省','赣州市','解放路1号'),(2,2,'广西省','柳州市','解放路10号'),(3,3,'福建省','宁德市','解放路5号'),(4,4,'广东省','汕尾市','解放路18号'),(5,5,'湖南省','长沙市','解放路100号'); + +#给作者表添加数据 + +insert into author VALUES +(1,1,'小飞飞','男',20),(2,1,'韦大力','女',50),(3,2,'卢比比','女',45),(4,3,'吴甲甲','男',60),(5,2,'王璇旋','男',70); + +#给订单表添加数据 + +insert into indent VALUES +(1,'刘能',1,'<<艺术是什么>>'),(2,'刘能',2,'<<唐朝发展史>>'),(3,'赵四',1,'<<黑洞的形成>>'),(4,'赵四',2,'<<自救小知识>>'); + +#给订单地址表添加数据 + +insert into indent_address VALUES +(1,1,'广东省','汕头市','改革路1号'),(2,2,'广东省','汕尾市','改革路100号'),(3,3,'广西省','柳州市','柳州路8号'),(4,4,'福建省','三明','府前路1号'); + +#给图书表添加数据 + +insert into book VALUES +(1,1,1,1,2,1,1,'<<艺术是什么>>','小飞飞','2002-04-12',48188489894198,25.5,'艺术的起源'),(2,3,3,2,2,3,1,'<<黑洞的形成>>','卢比比','2002-07-20',48188465894198,30.5,'黑洞的形成原因'),(3,2,3,1,2,4,1,'<<唐朝的发展史>>','吴甲甲','2005-07-30',48188129894198,45.0,'唐朝的兴盛与衰败'),(4,4,2,3,1,3,0,'<<论语>>','韦大力','2025-07-01',48188410894198,75.0,'唐朝的兴盛与衰败'),(5,5,1,1,3,4,1,'<<自救小知识>>','王旋旋','2015-01-25',48100489894198,5.0,'如何自救和救助他人'); + +#查询图书信息 + +select b_id,b_name as 书名,author as 作者,p_time as 出版时间 ,`code` as 条形码号码 ,b_content as 简介 ,s_name as 状态 ,pname as 出版社 ,c_name as 类型 ,tname as 材质,price as 价格 from book +join statue on statue.s_id=book.s_id +JOIN press on press.pid=book.pid +JOIN volume on volume.v_id=book.v_id +JOIN classify on classify.c_id=book.c_id +join texture on texture.tid=book.tid +join picture on picture.p_id=book.p_id; +``` + +### 测试结果 + +![image-20240914164405355](https://gitee.com/ygzdegitee/img/raw/master/imgs/202409141644513.png) + -- Gitee