Databases · Middle · Question 68 of 75
What does GROUP BY ROLLUP (country, city) add to the result?
- 1Rows sorted by country and city
- 2Only the grand total
- ✓Correct answer: Subtotal rows per country and a grand total, in addition to the per-city groups
Explanation
In subtotal rows the rolled-up columns are NULL; GROUPING() tells them apart from real NULLs. CUBE and GROUPING SETS give other combinations.