Oracle Database SQL — Question 184
Which two statements are true about the WHERE and HAVING clauses in a SELECT statement? (Choose two.)
Answer options
- A. WHERE and HAVING clauses can be used in the same statement only if applied to different table columns.
- B. The WHERE clause can be used to exclude rows after dividing them into groups.
- C. The HAVING clause can be used with aggregating functions in subqueries.
- D. The WHERE clause can be used to exclude rows before dividing them into groups.
- E. Aggregating functions and columns used in HAVING clauses must be specified in the SELECT list of a query.
Correct answer: C, D
Explanation
The correct answer is C and D. The HAVING clause is indeed used with aggregate functions, making C correct, while D accurately states that the WHERE clause filters rows before any grouping occurs. Options A and B are incorrect as they misrepresent the functionality of these clauses, and option E is not a requirement for using HAVING.