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
GROUPING SETS
Summary

Instruction

How about trying this exercise?

Exercise

Show the average interest amounts for the following grouping sets:

  1. ROLLUP by Year and Quarter
  2. Country

Show the following columns in the query result: GroupingId (depending on Year, Quarter, and Country respectively), Year, Quarter, Country, and AvgInterest.

Stuck? Here's a hint!

In the GROUP BY clause, use:

GROUPING SETS
(
  ROLLUP (Year, Quarter),
  (Country)
)