Professional Documents
Culture Documents
DBMS Assignment(Week 8)
DBMS Assignment(Week 8)
DBMS Assignment(Week 8)
Display the list of employees sorted by DEPTNO in ascending order and by SAL in
descending order.
Display the number of employees by department (displaying by department its number and
name).
SELECT DEPTNO, AVG(SAL + NVL(COMM 0)) AS AVG_SAL FROM EMP GROUP BY DEPTNO;
SELECT JOB, AVG( COMM) AS AVG_COMM FROM EMP WHERE COMM IS NOT NULL AND
COMM != 0 GROUP BY JOB;
Display the total salaries of employees who have the same direct superior as "BLAKE".
SELECT SUM(SAL) AS TOTAL_SAL FROM EMP WHERE MNG = (SELECT EMPNO FROM EMP
WHERE UPPER(last_name) = 'BLAKE');