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;
Answer:A
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;
Explanation: For aggregate functions group by clause is necessary.