QuestionQ5

Executing queries using Databricks SQL and Databricks SQL Warehouses

A data analyst processes a complex aggregation on a table containing zero null values, and the query returns the following result:

Question Image

Which query did the analyst run to produce this result?

  • A
  • B
  • C
  • D
Explanation

GROUP BY group_1, group_2 WITH ROLLUP adds hierarchical super-aggregate rows: a subtotal for each group_1 value with group_2 shown as NULL, followed by a grand-total row with both grouping columns shown as NULL. These are rollup markers rather than NULL values from the source table. A CUBE would additionally return totals for each group_2 value across all group_1 values.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!