当前位置:网站首页>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
边栏推荐
猜你喜欢

菜菜的并发编程笔记 |(九)异步IO实现并发爬虫加速

Background management system framework, there is always what you want

页面实时显示当前时间

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

Nacos / sentinel gateway current limiting and grouping (code)

BTree、B+Tree和HASH索引

保洁阿姨都能看懂的中国剩余定理和扩展中国剩余定理

SAP PI/PO Soap2Proxy 消费外部ws示例

FSM有限状态机

数论分块(整除分块)
随机推荐
2022.3.14 阿里笔试
13.用户和权限管理
[CodeForces - 208E] Blood Cousins(k代兄弟问题)
4.多表查询
1.查看数据库和表
2022.3.14 Ali written examination
[COCI]Lampice (二分+树分治+字符串哈希)
安装配置淘宝镜像npm(cnpm)
【TED系列】一个习惯是如何改变我的一生
SAP TRANSLATE使用数据对象掩码示例
Nacos/sentinel网关限流和分组 (代码)
SAP PI/PO rfc2RESTful 發布rfc接口為RESTful示例(Proxy間接法)
BTree、B+Tree和HASH索引
Educational Codeforces Round 81 (Rated for Div. 2)
Authorization+Token+JWT
[COCI] Vještica (子集dp)
10. Update operation
Solutions to common problems in visualization (VII) solutions to drawing scale setting
菜菜的并发编程笔记 |(九)异步IO实现并发爬虫加速
学习笔记5-梯度爆炸和梯度消失(K折交叉验证)