当前位置:网站首页>MySQL第九次作业-连接查询&子查询
MySQL第九次作业-连接查询&子查询
2022-06-26 09:37:00 【m0_61961898】
- 查询“Chisel”所在车间的车间编号、车间主任姓名、主任联系方式
- select no,name,phone from lingjinzheng_workshop where no in(select
shop_no from zhongzheng_worker where name=“Chisel”);
查询所有员工姓名、员工联系电话、车间地址、车间主任姓名、主任联系方式
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;
查询“Chisel”所在车间的所有员工姓名、员工联系电话、车间地址
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”;
查询生产出质量达标产品的产品编号、员工姓名、员工联系电话
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”
- 查询已生产产品车间的车间号、平均工龄
select shop_no ,avg(seniority) from lingjinzheng_worker where
shop_no=“WS2”;

查询所有产品的产品编号、是否合格(合格返回true不合格返回false)、员工号、员工姓名、员工联系方式、车间编号、车间地址
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;
- 查询员工表中是否存在“common”工种的员工,如果存在则查询员工表“common”工种员工的所有字段信息
select * from lingjinzheng_worker where work_type=“common”;

查询存在离职员工的车间编号、车间主任、主任联系方式
select no,name,phone from lingjinzheng_workshop where no in(select
shop_no from lingjinzheng_worker where is_onwork=“0”);

边栏推荐
- Omni channel, multi scenario and cross platform, how does app analyze channel traffic with data
- 1. sum of two numbers (leetcode topic)
- P1296 whispers of cows (quick row + binary search)
- What is in the method area - class file, class file constant pool, runtime constant pool
- [binary search] 4 Find the median of two positive arrays
- String类intern()方法和字符串常量池
- Threading model in webrtc native
- JVM的符号引用和直接引用是什么
- What are the symbolic and direct references of the JVM
- The IE mode tab of Microsoft edge browser is stuck, which has been fixed by rolling back the update
猜你喜欢

A list of common methods for customizing paint and canvas of view

Constraintlayout control uses full Raiders

【Leetcode】76. 最小覆盖子串

Differences between JVM, Dalvik and art

Allocation of heap memory when creating objects

C中字符串基本操作

exec系列函数(execl、execlp、execle、execv、execvp)使用

118. Yanghui triangle

MySQL第十次作业-视图

The basis of C language grammar -- pointer (multidimensional array, function, summary) learning
随机推荐
JVM的符号引用和直接引用是什么
Learning and understanding of thread pool (with code examples)
Pytest configuration file
Redis master-slave replication in win10 system
MySQL 13th job - transaction management
1. sum of two numbers (leetcode topic)
JSP file syntax
From TF 1 X to TF 2.6 (update if you encounter it)
mysql学习总结
如何更改微信小程序二维码物料颜色
Global and Chinese markets in hair conditioner 2022-2028: Research Report on technology, participants, trends, market size and share
MySQL第十四次作业--电子商城项目
Global and Chinese market of electronic pet door 2022-2028: Research Report on technology, participants, trends, market size and share
Recyclerview implements flow layout (LinearLayout with line wrap) (flexboxlayoutmanager)
String class intern() method and string constant pool
How do technicians send notifications?
Nested recyclerview in nestedscrollview automatically slides to the bottom after switching
Battery historian analyzes battery consumption
cmake / set 命令
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)