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

Examine the description of the EMPLOYEES table:

You write this failing statement:

Which clause causes the error?

    Correct Answer: B

    The GROUP BY clause in SQL statements cannot use column aliases that are defined in the SELECT list. In the provided query, 'department_id' is an alias for 'dept_no' defined in the SELECT clause. Therefore, using 'department_id' in the GROUP BY clause causes the error. Instead, 'dept_no' should be used directly in the GROUP BY clause.

Discussion
lucemqyOption: B

B GROUP BY cannot use alias

yaya32Option: B

B is correct