티스토리 뷰

11. EMPLOYEES 테이블로부터 department_id가 50인 사원들의 employee_id, last_name, salary값을 가지는 empvu50 뷰를 생성하는 DDL 구문을 작성하시오.


1
2
3
4
create view empvu50
as select employee_id, last_name, salary
    from employees
    where department_id = 50;
cs


12. EMPLOYEES 테이블로부터 last_name이 'Abel'인 사원보다 급여를 더 많이 받는 사람의 employee_id, last_name, salary를 출력하는 SQL 구문을 작성하시오.


1
2
3
4
5
select employee_id, last_name, salary
from employees
where salary > (select salary
                from employees
                where last_name = 'Abel');
cs


13. 부서별 사원의 수를 구하는 쿼리구문을 작성하여 실행한 결과 다음과 같은 오류가 발생하였다. 정상적인 수행을 위해 쿼리구문을 재작성하시오.



1
2
3
select department_id, count(last_name)
from employees
group by department_id;
cs


14. EMPLOYEES 테이블을 사용하여 사원의 LAST_NAME과 COMMISSION_PCT를 출력하되 커미션을 받는 사원의 정보만 출력하는 쿼리 구문을 작성하시오.


1
2
3
select last_name, commission_pct
from employees
where commission_pct is not null;
cs


15. Employees 테이블과 Employees 테이블을 self-join 하여, 사원들의 last_name(emp)과 사원의 매니저 last_name(mgr)을 함께 출력하는 쿼리 구문을 작성하시오. (단, 괄호 안의 이름을 column heading으로 출력하시오.)


1
2
3
select e1.last_name as emp, e2.last_name as mgr
from employees e1 join employees e2
on e1.manager_id = e2.employee_id;
cs



'부산 ITWILL 학원 실습 > ORACLE' 카테고리의 다른 글

[SQL 활용] SQL 평가  (0) 2018.08.09
[SQL 활용] 시험4  (0) 2018.08.09
[SQL 활용] 시험2  (0) 2018.08.09
[SQL 활용] 시험1  (0) 2018.08.09
[SQL 활용] 퀴즈 3  (0) 2018.08.09
공지사항
최근에 올라온 글
Total
Today
Yesterday