Changes

Jump to: navigation, search

J.Y.S

476 bytes added, 16:56, 20 October 2010
7.
having min(salary) between 5000 and 15000
order by department_id, job_id
</pre>
 
''FINAL''
<pre>
SELECT department_id, job_id, AVG(salary) "Average Dept/Job Pay",
MIN(salary) "Lowest Dept/Job Pay"
FROM employees
WHERE UPPER(job_id) NOT LIKE '%VP'
AND department_id = ALL
(SELECT department_id
FROM departments
WHERE UPPER(department_name) IN ('IT','SALES'))
GROUP BY department_id, job_id
HAVING MIN(salary) BETWEEN 5000 AND 15000
ORDER BY department_id, job_id;
</pre>

Navigation menu