1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Oracle sql query

  1. Jul 15, 2013 #1
    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.
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted



Similar Discussions: Oracle sql query
  1. Writing SQL queries (Replies: 1)

  2. AC analysis query (Replies: 0)

Loading...