Exam 1z0-071 All QuestionsBrowse all questions from this exam
Question 105

Examine this description of the EMP table:

You execute this query:

What is the result?

    Correct Answer: A

    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.

Discussion
andrejshilin16Option: D

Answer D, since in GROUP BY clause must used column names instead positioned numbers like here, like GROUP BY deptno - works fine

zouveOption: D

D ORA-00979: not a GROUP BY expression

katsoufisOption: A

why D? A is correct

Rik92

Because the Group by requires all items in the select clause

Rik92

Correction: One can order by 1 but you have to name the group by columns