1 查询所有员工的姓名(last_name+' '+first_name), 工资,年终奖金(工资的百分之八十 乘以 commission_pct 在加 500)别名(年终奖)。
2 查询所有有人员的部门编号,并且去掉重复行。
3 查询员工的姓名,工资,岗位 (JOB_ID),要求工资为 2000~3000 并且 JOB_ID 以‘ERK’结束
4 查询所有有人员的岗位编号,要求岗位 (JOB_ID) 中包含‘L’同时岗位 (JOB_ID) 名称以‘N’或‘K’结束,去掉重复行。
答案:
select last_name || ' ' || first_name "姓名",salary "工资",500+salary*(0.8)*nvl(commission_pct,0) "年终奖金" from hr.employees
select distinct department_id from hr.employees
select last_name || ' ' || first_name "姓名",salary "工资",job_id "岗位" from hr.employees where job_id like '%erk' and salary between 2000 and 3000
select job_id from hr.employees where job_id like '%L%N' or job_id like '%L%K'
注释:hr.employees为对应的表