当前位置:网站首页>MySQL 9th job - connection Query & sub query
MySQL 9th job - connection Query & sub query
2022-06-26 10:28:00 【m0_ sixty-one million nine hundred and sixty-one thousand eight】
- Inquire about “Chisel” Workshop number of the workshop 、 Name of workshop director 、 Contact information of the director
- select no,name,phone from lingjinzheng_workshop where no in(select
shop_no from zhongzheng_worker where name=“Chisel”);
Query the names of all employees 、 Employee contact number 、 Workshop address 、 Name of workshop director 、 Contact information of the director
select z.name,z.phone,x.address,x.name,x.phone from lingjinzheng_worker
z right join lingjinzheng_workshop x on z.shop_no=x.no;
Inquire about “Chisel” Names of all employees in the workshop 、 Employee contact number 、 Workshop address
select z.name,z.phone,x.address from lngjinzheng_worker z inner join
lingjinzheng_workshop x on z.shop_no=x.no where z.shop_no=“WS1”;
Query the product number of products with qualified quality 、 Employee name 、 Employee contact number
select z.no,x.name,x.phone from lingjinzheng_product z inner join
lingjinzheng_worker x on z.work_no=x.no where is_qualified=“1”
- Query the workshop number of the workshop where the products have been produced 、 Average length of service
select shop_no ,avg(seniority) from lingjinzheng_worker where
shop_no=“WS2”;

Check the product number of all products 、 Qualified or not ( Qualified return true Unqualified return false)、 Employee number 、 Employee name 、 Employee contact information 、 Workshop number 、 Workshop address
select z.no,z.is_qualified,a.no,a.name,a.phone,b.no,b.address from
linjinzheng_product z inner join lingjinzheng_worker a on z.work_no=a.no
inner join lingjinzheng_workshop b on a.shop_no=b.no;
- Query whether there exists in the employee table “common” Employees of the type of work , If it exists, query the employee table “common” All field information of employees of the type of work
select * from lingjinzheng_worker where work_type=“common”;

Query the workshop number of resigned employees 、 Workshop director 、 Contact information of the director
select no,name,phone from lingjinzheng_workshop where no in(select
shop_no from lingjinzheng_worker where is_onwork=“0”);

边栏推荐
- 什么是僵尸网络
- Servlet learning notes II
- String类intern()方法和字符串常量池
- [sans titre]
- 35 qlineedit control synthesis example
- Allocation de mémoire tas lors de la création d'objets
- What is in the method area - class file, class file constant pool, runtime constant pool
- [depth first search] 312 Poke balloon
- Index summary of blog articles -- Industrial Internet
- Constraintlayout control uses full Raiders
猜你喜欢
随机推荐
A list of common methods for customizing paint and canvas of view
微软 Edge 浏览器 IE 模式标签页出现卡死情况,已通过回滚更新修复
JVM垃圾回收什么情况会进入老年代
leetCode-链表的中间结点
US President signs community safety act to deal with gun issue
MySQL第六章总结
String constant pool, class constant pool, and runtime constant pool
Dialog centered
How to find and install the dependent libraries of Debian system
字符串常量池、class常量池和运行时常量池
The first batch of 12 enterprises settled in! Opening of the first time-honored product counter in Guangzhou
JSP file syntax
MySQL第七次作业-更新数据
The IE mode tab of Microsoft edge browser is stuck, which has been fixed by rolling back the update
开发者,微服务架构到底是什么?
Procedure Call Standard
MySQL第四章总结
exec系列函数(execl、execlp、execle、execv、execvp)使用
Introduction to stored procedure testing
Today's headline adaptation scheme code








