부서별 인원수를 출력하세요.

부서명 인원수

select d.department_name,count(e.employee_id)
from employees e, departments d
where e.department_id = d.department_id
group by d.department_name;

 

 

IT 부서에서 일하는 직원의 first_name, last_name, salary 를 출력하시요. 출력결과는 salary 가 낮은 사람부터 출력하시요. 전체 결과는 아래 수행결과처럼 하나의 문자열로 결합되어서 나와야 하며 전체 결과 하나의 컬럼으로 출력되도록 작성하세요.

select e.first_name || e.last_name || '의 연봉은 ' || e.salary   || ' 입니다.' as 결과
from employees e,departments d
where e.department_id = d.department_id
and d.department_name = 'IT'
order by salary asc;

 

 

각 사원(employee)에 대해서 사번(employee_id), 이름(first_name), 업무명(job_title), 부서명(department_name)를 조회하시오. 단 도시명(city)이 ‘Seattle’인 지역(location)의 부서(department)에 근무하는 직원만 출력하시오.

select e.employee_id,e.first_name,j.job_title,d.department_name
from employees e,departments d,jobs j,locations l
where e.department_id = d.department_id
and d.location_id = l.location_id and e.job_id = j.job_id
and l.city = 'Seattle';

 

+ Recent posts