Oracle2
第二天練習
?
用戶在hr/hr下面操作
1.?查詢和Zlotkey相同部門的員工姓名和雇用日期
2.?查詢工資比公司平均工資高的員工的員工號,姓名和工資。
3.?查詢各部門中工資比本部門平均工資高的員工的員工號,?姓名和工資
4.?查詢和姓名中包含字母u的員工在相同部門的員工的員工號和姓名
?select?e.employee_id,e.first_name,e.last_name?from
?(select?employee_id,first_name,last_name?from?employees
?where?first_name?like?'%u%')?s
?join?employees?e
?on?e.employee_id=s.employee_id;
?
5.?查詢在部門的location_id為1700的部門工作的員工的員工號
?select?employee_id?from?employees?e,departments?d,locations?l
?where?e.department_id=d.department_id
?and?d.location_id=l.location_id
?and?l.location_id=1700;
?
6.?查詢管理者是King的員工姓名和工資
?select?e.first_name,e.last_name,e.salary,e.manager_id
?from?employees?e,employees?m
?where?e.manager_id=m.manager_id
?and?m.last_name='King';
?
?
?
?
?
?
轉載于:https://www.cnblogs.com/xinyuyuanm/archive/2013/04/03/2998623.html
總結
- 上一篇: 获取本地数据库
- 下一篇: 解密QQ非会员漫游聊天记录