当前位置:网站首页>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”);

边栏推荐
- 創建對象的時候堆內存的分配
- libmagic 介绍
- Pytest configuration file
- MySQL第八次作业
- 方法区里面有什么——class文件、class文件常量池、运行时常量池
- What should the preview do?
- 1. 两数之和(LeetCode题目)
- Constraintlayout control uses full Raiders
- A list of common methods for customizing paint and canvas of view
- Global and Chinese markets in hair conditioner 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

MySQL第十一作业-视图的应用

字符串常量池、class常量池和运行时常量池

SwiftUI 开发经验之为离线优先的应用程序设计数据层

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

Standard implementation of streaming layout: a guide to flexboxlayout

看我在Map<String, String>集合中,存入Integer类型数据

Problems encountered in the application and development of Hongmeng and some roast

How to change the QR code material color of wechat applet

jar版本冲突问题解决

Develop current learning objectives and methods
随机推荐
Selection of webrtc video codec type VP8 H264 or other? (openh264 encoding, ffmpeg decoding)
libmagic 介绍
Record the handling of oom problems caused by too many threads at one time
Global and Chinese market of amateur football helmets 2022-2028: Research Report on technology, participants, trends, market size and share
全渠道、多场景、跨平台,App如何借助数据分析渠道流量
MySQL 13th job - transaction management
How to change the QR code material color of wechat applet
创建对象的时候堆内存的分配
开发者,微服务架构到底是什么?
echo $?
SwiftUI 开发经验之为离线优先的应用程序设计数据层
String constant pool, class constant pool, and runtime constant pool
Reshape a two-dimensional array with 3 rows and 3 columns to find the sum of the diagonals
Appium automation test foundation - mobile end test environment construction (II)
美国总统签署社区安全法案以应对枪支问题
echo $?
開發者,微服務架構到底是什麼?
Openxcap usage
Introduction to libmagic
Detailed explanation of winsorflow quantum installation process