Oracle Database Administration I — Question 51
Which two statements are true about the WHERE and HAVING clauses in a SELECT statement? (Choose two.)
Answer options
- A. Aggregating functions and columns used in HAVING clauses must be specified in the SELECT list of a query
- B. WHERE and HAVING clauses can be used in the same statement only if applied to different table columns
- 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. The WHERE clause can be used to exclude rows after dividing them into groups
Correct answer: C, D
Explanation
The correct answers are C and D. The HAVING clause is specifically designed to work with aggregating functions, and it can be utilized in subqueries. The WHERE clause filters rows before any grouping occurs, whereas the other options incorrectly describe the usage of these clauses.