Save up to $499! Grab all Python courses for $49 or all online courses we’ve ever launched for only $169. Only Feb 11-16. Happy Valentine's!
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)