当前位置:网站首页>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;
边栏推荐
- 自动化测试——关于unitest与pytest初始化共存问题
- Omni channel, multi scenario and cross platform, how does app analyze channel traffic with data
- The basis of C language grammar -- factoring by function applet
- In the fragment, the input method is hidden after clicking the confirm cancel button in the alertdialog (this is valid after looking for it on the Internet for a long time)
- Crawler related articles collection: pyppeter, burpsuite
- Dialog centered
- 創建對象的時候堆內存的分配
- 2. 合并两个有序数组
- Little red book - Summary of internal sales spike project
- mysql学习总结
猜你喜欢

【LeetCode】59. Spiral matrix II

Appium automation test foundation - mobile end test environment construction (II)

WGCLOUD的web ssh服务端口是多少

MySQL learning summary

About multi table query of MySQL

Use of exec series functions (EXECL, execlp, execle, execv, execvp)

118. Yanghui triangle

904. fruit baskets

Call API interface to generate QR code of wechat applet with different colors

Cloud native essay using Hana expression database service on Google kubernetes cluster
随机推荐
118. 杨辉三角
Automated testing -- Introduction and example of pytest framework
Configuration internationale
全渠道、多场景、跨平台,App如何借助数据分析渠道流量
如何更改微信小程序二维码物料颜色
Selection of webrtc video codec type VP8 H264 or other? (openh264 encoding, ffmpeg decoding)
The IE mode tab of Microsoft edge browser is stuck, which has been fixed by rolling back the update
Today's headline adaptation scheme code
Appium自动化测试基础 — 移动端测试环境搭建(二)
In the fragment, the input method is hidden after clicking the confirm cancel button in the alertdialog (this is valid after looking for it on the Internet for a long time)
The basis of C language grammar -- learning of local variables and storage categories, global variables and storage categories, and macro definitions
jar版本冲突问题解决
LSP 是什么
MySQL第十三次作业-事务管理
[binary search] 4 Find the median of two positive arrays
Retrofit common request methods and comments, post, get heard file upload
Call API interface to generate QR code of wechat applet with different colors
Small example of SSM project, detailed tutorial of SSM integration
The basis of C language grammar -- factoring by function applet
Poj3682 king arthur's birthday celebration (probability)