Databases · Middle · Question 68 of 75

What does GROUP BY ROLLUP (country, city) add to the result?

Explanation

In subtotal rows the rolled-up columns are NULL; GROUPING() tells them apart from real NULLs. CUBE and GROUPING SETS give other combinations.

Further reading

Problem with a question

Databases · Middle · question 68

Test yourself

Take the Databases · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz