--QUIZ --전체 직원명, 급여, 직급별 평균 급여 SELECT ENAME, SAL, AVG_SAL FROM EMP E JOIN( SELECT JOB, AVG(SAL) AVG_SAL FROM EMP GROUP BY JOB ) J ON E.JOB = J.JOB; SELECT ENAME, SAL, (SELECT AVG(SAL) FROM EMP E WHERE E.JOB=E2.JOB) FROM EMP E2;
--QUIZ --전체 직원명, 급여, 직급별 평균 급여 SELECT ENAME, SAL, AVG_SAL FROM EMP E JOIN( SELECT JOB, AVG(SAL) AVG_SAL FROM EMP GROUP BY JOB ) J ON E.JOB = J.JOB;
SELECT ENAME, SAL, (SELECT AVG(SAL) FROM EMP E WHERE E.JOB=E2.JOB) FROM EMP E2;