Which two statements are true about WHERE and HAVING clauses? (Choose two)
A. A WHERE clause can be used to restrict both rows and groups.
B. A WHERE clause can be used to restrict rows only.
C. A HAVING clause can be used to restrict both rows and groups.
D. A HAVING clause can be used to restrict groups only.
Answer: B, C
Explanation :
HAVING clause to specify which groups are to be displayed and thus further restrict the groups on the basis of aggregate information.
The Oracle server performs the following steps when youuse the Having clause
1. rows are grouped
2. the group function is applied to the group
3. the group that match the criteria in the Having clause are displayed.
WHERE clause cannot be use to restrict groups
HAVING clause use to restrict groups
WHERE clause cannot be use when there is group functions.
Incorrect Answers :
A. Where clause cannot be use to restrict groups
D. When HAVING clause is use rows are grouped as well.
Comments