当前位置:网站首页>MySQL第十次作业-视图
MySQL第十次作业-视图
2022-06-26 09:37:00 【m0_61961898】
创建视图“view_info”,查询所有员工姓名、员工联系电话、车间地址、车间主任姓名、主任联系方式
create view view_info as select z.names,z.phones,c.address,c.name,c.phone from lingjinzheng_workshop c left join lingjinzheng_worker z on c.no=z.shop_no;![]()
查看“view_info”视图字段信息
select * from view_info;
创建视图“view_ chisel”,查询“Chisel”所在车间的所有员工姓名、员工联系电话、车间地址
create view view_chisel as select z.names,z.phones,c.address from lingjinzheng_workshop c left join lingjinzheng_worker z on c.no=z.shop_no where names like"Chisel";![]()
查看库中所有表
show tables; 
创建视图“view_ standard”,查询生产出质量达标产品的产品编号、员工姓名、员工联系电话‘
create view view_standard as select cp.nos2,z.names,z.phones from lingjinzheng_worker z left join lingjinzheng_product cp on z.nos=cp.work_no ;
查看“view_ standard”视图创建语句
show create view view_standard\G;
创建视图“view_ product”,查询所有产品的产品编号、是否合格、员工号、员工姓名、员工联系方式、车间编号、车间地址
create view view_product as select cp.nos2,cp.IS_QUALIFIED,z.nos,z.names,z.phones,c.no,c.address from(lingjinzheng_workshop c left join lingjinzheng_worker z on c.no=z.shop_no)left join lingjinzheng_product cp on z.nos=cp.work_no;

查看库中所有表
show tables;
删除“view_ chisel”视图
drop view view_chisel;
创建视图“view_ leave”,查询存在离职员工的车间编号、车间主任、主任联系方式
create view view_leave as select cp.NOs2,c.name,c.phone from(lingjinzheng_workshop c left join lingjinzheng_worker z on c.no=z.shop_no)left join lingjinzheng_product cp on z.nos=cp.work_no where z.IS_ONWORK like"0";![]()
查看库中所有表
show tables;
边栏推荐
猜你喜欢

Allocation de mémoire tas lors de la création d'objets

WGCLOUD的web ssh服务端口是多少

Differences between JVM, Dalvik and art

Cloud native essay using Hana expression database service on Google kubernetes cluster

mysql学习总结

904. 水果成篮

cmake / set 命令

About multi table query of MySQL

Test instructions - common interface protocol analysis

Appium automation test foundation - mobile end test environment construction (II)
随机推荐
Retrofit common request methods and comments, post, get heard file upload
cmake / set 命令
Automated testing -- on the coexistence of Unitest and pytest initialization
【深度优先搜索】312.戳气球
3行3列整形二维数组,求对角之和
Little red book - Summary of internal sales spike project
Day 3 array, pre post, character space, keyword and address pointer
How to start the learning journey of webrtc native cross platform development?
What is in the method area - class file, class file constant pool, runtime constant pool
JSP file syntax
Record the handling of oom problems caused by too many threads at one time
JVM的符号引用和直接引用是什么
Problems encountered in the application and development of Hongmeng and some roast
String类intern()方法和字符串常量池
jar版本冲突问题解决
TensorFlow动态分配显存
leetCode-链表的中间结点
[depth first search] 312 Poke balloon
1. 两数之和(LeetCode题目)
cento7.7安装ELK简单记录