Multiple choice

Select a query to display the average salary of those departments that have an average salary greater than 2000.

Consider the following relation schema ..... EMP(ENAME,EMPNO,SAL,COMM,DEPTNO,JOB,MGR,HIREDATE)...

  1. select avg(SAL), DEPTNO, from EMP group by DEPTNO having avg(SAL)>2000;

  2. select avg(SAL), DEPTNO, from EMP where group by DEPTNO having avg(SAL)>2000;

  3. select avg(SAL), DEPTNO, from EMP group by DEPTNO where avg(SAL)>2000;

  4. select avg(SAL), DEPTNO, from EMP group by DEPTNO having avg(SAL)>2000

  5. none of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

At the time of using group by we use having instead of where.