1. Learn
  2. /
  3. Courses
  4. /
  5. Time Series Analysis in SQL Server

Exercise

View all aggregations with CUBE

The CUBE operator provides a cross aggregation of all combinations and can be a huge number of rows. This operator works best with non-hierarchical data where you are interested in independent aggregations as well as the combined aggregations.

In this scenario, we wish to find the total number of security incidents in the IncidentRollup table but will not follow a proper hierarchy. Instead, we will focus on aggregating several unrelated attributes.

Instructions 1/2

undefined XP
    1
    2
  • Fill in the missing columns from dbo.Calendar in the SELECT clause.
  • Fill out the GROUP BY segment, including the CUBE operator.