diff --git "a/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232.zip" "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232.zip" new file mode 100644 index 0000000000000000000000000000000000000000..f6cd1a80e9f1fafd64771600e875c7d7f33dca0d Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232.zip" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\345\217\202\350\200\203\347\255\224\346\241\2102.sql" "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\345\217\202\350\200\203\347\255\224\346\241\2102.sql" new file mode 100644 index 0000000000000000000000000000000000000000..c56068cacf900040c2e786e29c38b7d6bc133ea2 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\345\217\202\350\200\203\347\255\224\346\241\2102.sql" @@ -0,0 +1,95 @@ +create database test_002 charset utf8; +use test_002; +create table user_information( +id int, +flower_owner varchar(20), +delivery_address varchar(20), +flower_book varchar(20), +phone_number varchar(20), +vip_id varchar(20), +age varchar(20) +); +create table flower_variety( +families_genera varchar(20), +flower_name varchar(20), +id int, +flowers_prise varchar(20) +); +create table vips( +vip_id varchar(20), +vip_name varchar(20) +); + +create table sales_volume( +id int, +sales varchar(20) +); + +insert into user_information values +(1,'高圆圆','江西南昌','郁金香','16634575678','vip_01',18), +(2,'张泡泡','河南洛阳','玫瑰','13387639807','vip_02',18), +(3,'李杠杠','河南郑州','向日葵','15432456789','vip_03',18), +(4,'黄灿灿','福建龙岩','满天星','13454367890','vip_03',18), +(5,'欧阳盼盼','福建龙岩','卡布奇诺','15487908767','vip_01',18), +(6,'张大大','河南洛阳','爱莎','16578980965','vip_04',18), +(7,'李小小','福建龙岩','绣球花','15498099980','vip_05',18), +(8,'高滴滴','福建龙岩','茉莉花','16678905432','vip_05',18); +insert into flower_variety VALUES +('百合花','郁金香',1,'¥200'), +('蔷薇花','玫瑰',2,'¥198'), +('菊科','向日葵',3,'¥298'), +('石竹','满天星',4,'¥99'), +('蔷薇花','卡布奇诺',5,'¥999'), +('蔷薇花','爱莎',6,'¥899'), +('虎耳草','绣球花',7,'¥199'), +('木犀','茉莉花',8,'¥19'); +insert into vips values +('vip_01','青铜'), +('vip_01','白银'), +('vip_03','黄金'), +('vip_03','黄金'), +('vip_01','青铜'), +('vip_04','钻石'), +('vip_05','王者'), +('vip_05','王者'); + +insert into sales_volume VALUES +(1,'20'), +(2,'15'), +(3,'65'), +(4,'85'), +(5,'47'), +(6,'25'), +(7,'35'), +(8,'15'); + +-- 1.根据前面提供的表结构和表数据,创建数据库并创建这三张表,并插入相关数据 +-- +-- 2.将user_information表中的age字段类型改为int +alter table user_information modify age int; +-- 3.将user_information表中的李小小的订购花的品种改为卡布奇诺 +update user_information set flower_book='卡布奇诺' where flower_owner='李小小'; +-- 4.将user_information表中增加一个性别字段,字段名:flowersex 类型:char(10) 要求默认值为男 +alter table user_information add flowersex char(10) default '男'; +-- 5.将user_information表中编号前五的性别改为女 +update user_information set flowersex='女' where id between 1 and 5; +-- 6.将VIP表中王者等级倒序 +select * from vips order by vip_id desc; +-- 7.查询出user_information表中的送货地址有几种 +select distinct delivery_address from user_information; +-- 8.查询出flower_variety表中¥999的花的花名 +select * from flower_variety where flowers_prise='¥999'; +-- 9.查询出flower_variety表中的花价,并按降序排列 +select * from flower_variety order by flowers_prise desc; +-- 10.查询出user_information表中张姓的送货地址,联系电话,等级编号 +select delivery_address,phone_number,vip_id from user_information where flower_owner like '张%'; +-- 11.查询出user_information表中送货地址为福建龙岩,性别为女的所有信息 +select * from user_information where delivery_address='福建龙岩' and flowersex='女'; +-- 12.查询花的主人名中第三个字为盼,后面字母不限 +select * from user_information where flower_owner like '__盼%'; +-- 13.查询每个VIP等级有多少人 +select vip_id,count(vip_id) from user_information group by vip_id; +-- 14.显示出用户信息表的全部数据并给予中文别名 +select id 用户编号,flower_owner 用户姓名,delivery_address 用户住址,flower_book 订购种类,phone_number 用户电话,vip_id 用户等级,age 用户年龄,flowersex 用户性别 from user_information; +-- 15.求出各花的总销量 +select flower_book,count(flower_book) from user_information group by flower_book; \ No newline at end of file diff --git "a/14 \346\235\216\344\277\212\345\205\264/\345\244\247\344\275\234\344\270\232.md" "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\345\244\247\344\275\234\344\270\232.md" similarity index 100% rename from "14 \346\235\216\344\277\212\345\205\264/\345\244\247\344\275\234\344\270\232.md" rename to "14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\345\244\247\344\275\234\344\270\232.md" diff --git "a/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/2023-03-14_192536.png" "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/2023-03-14_192536.png" new file mode 100644 index 0000000000000000000000000000000000000000..8edfb24c53657697f92544e0cd07a9955d9e0187 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/2023-03-14_192536.png" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/2023-03-14_192634.png" "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/2023-03-14_192634.png" new file mode 100644 index 0000000000000000000000000000000000000000..29d49406e330b52b9f072abdbebdf0c0d0ddf878 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/2023-03-14_192634.png" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/2023-03-14_192755.png" "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/2023-03-14_192755.png" new file mode 100644 index 0000000000000000000000000000000000000000..a82367ac745d5a743827fd1b94c827bb40caf543 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/2023-03-14_192755.png" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314192901255.png" "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314192901255.png" new file mode 100644 index 0000000000000000000000000000000000000000..cb2a4488c2134149b8fda5ac925f8a12ba227ba7 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314192901255.png" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314192949247.png" "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314192949247.png" new file mode 100644 index 0000000000000000000000000000000000000000..630f75b358f51d94b13117d4fe0ff4c6de254ff3 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314192949247.png" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314193024747.png" "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314193024747.png" new file mode 100644 index 0000000000000000000000000000000000000000..2ad85c67c4ed1b1f99ffd98e669142c523290eae Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314193024747.png" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314193040788.png" "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314193040788.png" new file mode 100644 index 0000000000000000000000000000000000000000..4309d143ba5180df103908c3494a59bc8acd06a1 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314193040788.png" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314193107795.png" "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314193107795.png" new file mode 100644 index 0000000000000000000000000000000000000000..d6083de02aabba02f5c50cf18b654c75b90c9037 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314193107795.png" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314194751725.png" "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314194751725.png" new file mode 100644 index 0000000000000000000000000000000000000000..f3636e18bfdcc2c680b27f70e8db4cb5b46eee4f Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/\344\275\234\344\270\232/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/image-20230314194751725.png" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/\351\242\230\347\233\256.md" "b/14 \346\235\216\344\277\212\345\205\264/\351\242\230\347\233\256.md" new file mode 100644 index 0000000000000000000000000000000000000000..bea54d6ceb8ce5d6b58feb19a57ac0e4b3dfba44 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/\351\242\230\347\233\256.md" @@ -0,0 +1,69 @@ +现在有一花店,要用MySQL给一个花店设计一个数据库 。 + +数据库名:florist’s + +### 用户信息表() + +![2023-03-14_192536](D:\MySQL库\mysql-base\14 李俊兴\作业\新建文件夹\2023-03-14_192536.png) + +### 花的品种表 + +![2023-03-14_192634](D:\MySQL库\mysql-base\14 李俊兴\作业\新建文件夹\2023-03-14_192634.png) + +### 销量表 ### + +![2023-03-14_192755](D:\MySQL库\mysql-base\14 李俊兴\作业\新建文件夹\2023-03-14_192755.png) + +### VIP表 + +![image-20230314192901255](D:\MySQL库\mysql-base\14 李俊兴\作业\新建文件夹\image-20230314192901255.png) + +### 用户信息表数据 + +![image-20230314192949247](D:\MySQL库\mysql-base\14 李俊兴\作业\新建文件夹\image-20230314192949247.png) + +### 花的品种表数据 + +![image-20230314193024747](D:\MySQL库\mysql-base\14 李俊兴\作业\新建文件夹\image-20230314193024747.png) + +### 销量表 ### + +![image-20230314193040788](D:\MySQL库\mysql-base\14 李俊兴\作业\新建文件夹\image-20230314193040788.png) + +### VIP表数据 + +![image-20230314193107795](D:\MySQL库\mysql-base\14 李俊兴\作业\新建文件夹\image-20230314193107795.png) + +### 题目 + +1.根据前面提供的表结构和表数据,创建数据库并创建这三张表,并插入相关数据 + +2.将user_information表中的age字段类型改为int + +3.将user_information表中的李小小的订购花的品种改为卡布奇诺 + +4.将user_information表中增加一个性别字段,字段名:flowersex 类型:char(10) 要求默认值为男 + +5.将user_information表中编号前五的性别改为女 + +6.将VIP表中王者等级名称放在字段第一位 + +7.查询出user_information表中的送货地址有几种 + +8.查询出flower_variety表中¥999的花的花名 + +9.查询出flower_variety表中的花价,并按降序排列 + +10.查询出user_information表中张姓的送货地址,联系电话,等级编号 + +11.查询出user_information表中送货地址为福建龙岩,性别为女的所有信息 + +12.查询花的主人名中第三个字为盼,后面字母不限 + +13.查询每个VIP等级有多少人 + +14.显示出用户信息表的全部数据并给予中文别名 + + + +