Examine this description of the EMP table:
You execute this query:
What is the result?
Examine this description of the EMP table:
You execute this query:
What is the result?
The query uses the GROUP BY clause to group the rows by department (using the deptno column). The SUM function is applied to the salaries of each department, and the HAVING clause filters these groups to return only those departments where the total salary exceeds 3000. The GROUP BY clause works correctly in this context, even with the positional reference '1' to the first column in the SELECT statement. Therefore, the result will be only the departments where the total salary is greater than 3000, and they will be returned in no particular order.
Answer D, since in GROUP BY clause must used column names instead positioned numbers like here, like GROUP BY deptno - works fine
D ORA-00979: not a GROUP BY expression
why D? A is correct
Because the Group by requires all items in the select clause
Correction: One can order by 1 but you have to name the group by columns