-- 1. 연봉이 12000 이상되는 직원들의 LAST_NAME 및 연봉을 조회한다.
select last_name, salary from employees where salary >= 12000 order by last_name asc;
-- 2. 사원번호가 122 인 사람의 LAST_NAME 과 부서 번호를 조회한다.
select last_name, department_id from employees where manager_id = 122 order by last_name asc;
-- 3. 연봉이 5000 에서 12000의 범위 이외인 사람들의 LAST_NAME 및 연봉을 조회힌다.
select last_name, salary from employees where salary < 5000 or salary > 12000 order by last_name asc;
-- 4. 2002/02/20 일부터 2005/05/01 사이에 고용된 사원들의 LAST_NAME 사번, 고용일자를 조회한다.
-- 고용일자 순으로 정렬한다.
select last_name, employee_id, hire_date from employees where hire_date >= '2002/02/20' and hire_date <= '2005/05/01' order by hire_date asc;
-- 5. 20 번 및 50 번 부서에서 근무하는 모든 사원들의 LAST_NAME 및 부서 번호를 알파벳순으로 조회한다.
select last_name, department_id from employees where department_id in (20, 50) order by last_name asc;
-- 6. 20 번 및 50 번 부서에 근무하며, 연봉이 5000 ~ 12,000 사이인 사원들의 LAST_NAME 및 연봉을 조회한다.
select last_name, salary from employees where department_id in (20, 50) and salary >= 5000 and salary <= 12000 order by last_name asc;
-- 7. 2004년도에 고용된 모든 사람들의 LAST_NAME 및 고용일을 조회한다.
select last_name, hire_date from employees where hire_date >= '2004/01/01' and hire_date <= '2004/12/31' order by last_name asc;
select last_name, hire_date from employees where hire_date like '04%' order by last_name asc;
-- 8-1. 매니저가 없는 사람들의 LAST_NAME 및 JOB_ID 를 조회한다.
select last_name, job_id from employees where manager_id is null order by last_name asc;
-- 8-2. 매니저가 있는 사람들의 LAST_NAME 및 JOB_ID 를 조회한다.
select last_name, job_id from employees where manager_id is not null order by last_name asc;
-- 9. 커미션을 버는 모든 사원들의 LAST_NAME, 연봉 및 커미션을 조회한다.
-- 연봉 역순, 커미션 역순차로 정렬한다.
select last_name, salary, commission_pct from employees where not (commission_pct is null) order by salary desc, commission_pct desc;
-- 10. LAST_NAME 의 네번째 글자가 a 인 사원들의 LAST_NAME 을 조회한다.
select last_name from employees where last_name like '___a%' order by last_name asc;
'업무활용300%' 카테고리의 다른 글
Win10 노트북 닫고 모니터 사용하기 (0) | 2022.01.23 |
---|---|
오라클 hr 연습문제(11~20) (0) | 2022.01.21 |
이클립스 삭제하기 (0) | 2022.01.19 |
윈도우10 계정 이름, 사용자 정보 변경 (0) | 2022.01.19 |
복사 단축키... Ctrl+C 크롬 강제 종료 현상 해결 (10) | 2022.01.18 |