Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
CUBE
Summary

Instruction

All right, it's your turn now.

Exercise

Show the sum of DamageRepairCost for grouping combinations based on the columns Year, Month, and Cause. Treat Year and Month as a single column.

Show the following columns in the query result: GroupingId (depending on Year, Month, and Cause), Year, Month, Cause, and SumDamageRepairCost.

Stuck? Here's a hint!

Use the following template:

SELECT
  GROUPING_ID(x, y, z) AS GroupingId,
  ...
FROM ...
GROUP BY 
  CUBE ((x, y), z)