Академический Документы
Профессиональный Документы
Культура Документы
Selects
1.The name of the department (departments), where is hired the
employee (employees) with the maximum salary.
2.The employees (last name, first name) with the maximum salary in each
department.
3.The name of the departments where each employee has at least one
subordinate.
5. The name of the employees from 'Oxford' which don’t have any
subordinates.
6. The name of employees, which have a salary higher than the average
salary in their department.
select first_name from employees a where salary > (select avg(salary) from
employees b where b.department_id=a.department_id)
7. The name of the departments where all employee names begin with 'W'.
select department_name from departments where not exists (select * from
employees where employees.department_id=departments.department_id and
employees.first_name not like 'W%')
-----------
inserts