当前位置:网站首页>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;
边栏推荐
- 創建對象的時候堆內存的分配
- #云原生征文# 在 Google Kubernetes Cluster 上使用 HANA Expression Database Service
- 动态库连接 - 符号冲突 - 全局符号介入
- Svn command
- Druid data source for background monitoring
- Introduction to libmagic
- [sans titre]
- Appium automation test foundation - mobile end test environment construction (II)
- 2. 合并两个有序数组
- Basic grammar of C language -- pointer (character, one-dimensional array) learning
猜你喜欢

Day 3 array, pre post, character space, keyword and address pointer

Solution to network request crash in retrofit2.8.1

MySQL第十四次作业--电子商城项目

Go learning notes (83) - code specification and common development skills

904. fruit baskets

SSM项目小例子,SSM整合图文详细教程

Redis master-slave replication in win10 system

What should the preview do?

【Leetcode】76. Minimum covering substring

微软 Edge 浏览器 IE 模式标签页出现卡死情况,已通过回滚更新修复
随机推荐
从tf 1.x到tf 2.6(遇到的就过来更新更新)
Specific implementation comparison between different programming languages
String constant pool, class constant pool, and runtime constant pool
MySQL第四章总结
2. merge two ordered arrays
SSM项目小例子,SSM整合图文详细教程
字符串常量池、class常量池和运行时常量池
Control setting layout in linear layout_ Gravity doesn't work?
Openxcap usage
Internationalization configuration
Cento7.7 elk installation simple record
Get the clicked position in the recyclerview
P1296 whispers of cows (quick row + binary search)
Win10安装tensorflow-quantum过程详解
A list of common methods for customizing paint and canvas of view
Glide's most common instructions
【无标题】
Detailed explanation of winsorflow quantum installation process
[untitled]
How do technicians send notifications?