当前位置:网站首页>4. Multi table query
4. Multi table query
2022-04-23 07:40:00 【Ah Dai cloth clothes cool】
4. Multi-table query
1. Check employee number 、 Name of employee 、 Wages 、 Name and location of Department
select empno,ename,sal,dname,loc
from emp e,dept d
where e.deptno=d.deptno
2. Check the employee's name 、 Wages 、 Entry time 、 Department number 、 Department name
select e.ename,e.sal,e.hiredate,d.deptno,d.dname
from emp e,dept d
where e.deptno=d.deptno
3. Check the employee's name 、 Employee salary 、 Leader's name 、 Leader salary
select e.ename Name of employee ,e.sal Employee salary ,m.ename Leader's name ,m.sal Leader salary
from emp e,emp m
where e.mgr=m.empno
4. Check the employee's name 、 Employee salary 、 Leader's name 、 Leader salary
select e.ename Name of employee ,e.sal Employee salary ,d.dname Department name ,m.ename Leader's name ,m.sal Leader salary
from emp e,dept d,emp m
where e.deptno=d.deptno and e.mgr=m.empno
5. Check the employee's name 、 Employee salary 、 Department name 、 Salary level
select e.ename Name of employee ,e.sal Employee salary ,d.dname Department name ,s.grade Pay scale
from emp e,dept d,salgrade s
where e.deptno=d.deptno and e.sal between s.losal and s.hisal;
6. Check the employee's name 、 Employee salary 、 Department name 、 Employee pay scale 、 Leader's name 、 Leader salary 、 Salary grade of leaders
select e.ename Name of employee ,e.sal Employee salary ,d.dname Department name ,s.grade Employee pay scale ,m.ename Leader's name ,m.sal Leader salary ,sm.grade Salary grade of leaders
from emp e,dept d,salgrade s,salgrade sm
where e.deptno=d.deptno
and e.sal between s.losal and s.hisal
and e.mgr=m.empno
and m.sal between sm.losal and sm.hisal;
版权声明
本文为[Ah Dai cloth clothes cool]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230622239440.html
边栏推荐
- 6. Aggregation function and grouping statistics
- On BFC (block formatting context)
- Methods of database query optimization
- Authorization+Token+JWT
- 14. Transaction processing
- 对STL容器的理解
- Background management system framework, there is always what you want
- Two threads print odd and even numbers interactively
- [self motivation series] what really hinders you?
- 莫比乌斯反演
猜你喜欢

SAP RFC_CVI_EI_INBOUND_MAIN BP主数据创建示例(仅演示客户)

BTree、B+Tree和HASH索引

Authorization server (simple construction of authorization server)

快速下载vscode的方法

How to judge whether a point is within a polygon (including complex polygons or a large number of polygons)

Authorization+Token+JWT

数据分析入门 | kaggle泰坦尼克任务(四)—>数据清洗及特征处理

页面动态显示时间(升级版)

redis连接出错 ERR AUTH <password> called without any password configured for the default user.

manjaro安装与配置(vscode,微信,美化,输入法)
随机推荐
判断字符串首尾是否包含目标参数:startsWith()、endsWith()方法
Django使用mysql数据库报错解决
[牛客练习赛68]牛牛的粉丝(矩阵快速幂之循环矩阵优化)
【自我激励系列】到底是什么真正阻碍了你?
游戏辅助脚本开发之旅
Authorization+Token+JWT
5.SQL99标准:内连接和外连接
What are the total number of all courses of Mr. Tang Xiaoyang, who is very popular in CSDN (question mark)
手游的热更方案与动态更新策略
Mysql持久性的实现
菜菜的并发编程笔记 |(五)线程安全问题以及Lock解决方案
‘npm‘不是内部或外部命令,也不是可运行的程序 或批处理文件
The difference between null and undefined
技能点挖坑
MySQL isolation level
Reflect on the limitations of event bus and the design and implementation of communication mechanism in component development process
On BFC (block formatting context)
[COCI] Vještica (子集dp)
Background management system framework, there is always what you want
1. View databases and tables