Open main menu

CDOT Wiki β

Changes

J.Y.S

466 bytes added, 22:29, 19 October 2010
7.
''Saad''
<pre>
SELECT department_id, job_id, AVG(salary) "Average Dept/Job Pay", MIN(salary) "Lowest Dept/Job Pay"
FROM employees
WHERE department_id <> ALL (SELECT department_id
FROM departments
WHERE UPPER(department_name) IN ('IT','SALES')
)
AND job_id NOT LIKE '%VP'
GROUP BY department_id, job_id
HAVING MIN(salary) BETWEEN 5000 AND 15000
ORDER BY department_id, job_id
/
</pre>
''James''
1
edit