r/DatabaseHelp • • Oct 16 '17

Oracle hr schema, subquery problem

Hi, I have been tasked with performing the following query: display the last_name, first_name, and department_id of all employees in the department that has the lowest average salary. Here is what I think the query should be: select department_id, last_name, first_name from employees where department_id in(select min(avg(salary)) from employees group by department_id); Please point me in the direction (Oracle documentation or elsewhere) to help me solve this problem. Thank you!

1 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Oct 17 '17

Hmwk deadline was last night. Ive got class later and will be shown the solution so Im totally giving up on solving this myself. Have I learned things-definitely.Like, I know practically nothing about sql. I probably should learn more. Also, my teacher is a sadist. And reddit peeps are the best. Thank you again!