Introduction
GROUPING SETS
Summary

Instruction

Nicely done! Now it's your turn.

Exercise

Find the average principal (as AvgPrincipal) and average interest (as AvgInterest) for the following grouping combinations:

  1. Year and Quarter
  2. Country
  3. None (overall averages)

Stuck? Here's a hint!

Use the template to help you:

SELECT
  A,
  B,
  ...
FROM X
GROUP BY GROUPING SETS
(
  (A),
  (B),
  ()
)