- #1
Naeem
- 194
- 0
Hello,
I have written the below queries, can somebody tell me if they are correct. manager_id in Employee Table - supervisor ; manager_id in departments table - manager.
names and department names of managers who do not supervise any employee.
select e.first_name|| ' ' ||e.last_name employee_name,d.department_name
from employees e join departments d
on e.employee_id =d.manager_id
where e.employee_id not in(select manager_id from employees where manager_id is not null)
supervisors but not managers
select e.first_name|| ' ' ||e.last_name employee_name
from employees e where e.employee_id in(select manager_id from employees where manager_id is not null)
and e.employee_id in (select manager_id from departments where manager_id is not null);
Employees who are managers and supervisors.
select e.first_name|| ' ' ||e.last_name employee_name
from employees e where e.employee_id in(select manager_id from employees where manager_id is not null)
and e.employee_id in (select manager_id from departments where manager_id is not null);
Any feedback much appreciated.
I have written the below queries, can somebody tell me if they are correct. manager_id in Employee Table - supervisor ; manager_id in departments table - manager.
names and department names of managers who do not supervise any employee.
select e.first_name|| ' ' ||e.last_name employee_name,d.department_name
from employees e join departments d
on e.employee_id =d.manager_id
where e.employee_id not in(select manager_id from employees where manager_id is not null)
supervisors but not managers
select e.first_name|| ' ' ||e.last_name employee_name
from employees e where e.employee_id in(select manager_id from employees where manager_id is not null)
and e.employee_id in (select manager_id from departments where manager_id is not null);
Employees who are managers and supervisors.
select e.first_name|| ' ' ||e.last_name employee_name
from employees e where e.employee_id in(select manager_id from employees where manager_id is not null)
and e.employee_id in (select manager_id from departments where manager_id is not null);
Any feedback much appreciated.