1.

Which of the following queries are legal?(a) SELECT deptno, count(deptno) FROM emp GROUP BY ename;(b) SELECT deptno, count(deptno), job FROM emp GROUP BY deptno;(c) SELECT deptno, avg(sal) FROM emp;(d) SELECT deptno, avg(sal) FROM emp GROUP BY deptno;The question was posed to me in final exam.I need to ask this question from Rapid Application Development topic in division Database Programming Techniques of Database Management

Answer»

The correct CHOICE is (d) SELECT deptno, avg(sal) FROM EMP GROUP BY deptno;

To explain: For aggregate functions group by CLAUSE is NECESSARY.



Discussion

No Comment Found

Related InterviewSolutions