1z0-071 Exam QuestionsBrowse all questions from this exam

1z0-071 Exam - Question 105


Examine this description of the EMP table:

You execute this query:

What is the result?

Show Answer
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

3 comments
Sign in to comment
katsoufisOption: A
Mar 7, 2023

why D? A is correct

Rik92
Mar 13, 2023

Because the Group by requires all items in the select clause

Rik92
Mar 13, 2023

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

zouveOption: D
Jun 24, 2023

D ORA-00979: not a GROUP BY expression

andrejshilin16Option: D
Jul 20, 2024

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