Kickstart 2020 with new opportunities! - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
GROUPING SETS
Summary

Instruction

Good job! One more interesting thing we can do with GROUPING SETS is combine them with ROLLUP or CUBE:

SELECT
  date_received,
  customer_id,
  repair_center,
  AVG(repair_duration) AS avg_repair_duration
FROM warranty_repair
GROUP BY GROUPING SETS
(
  ROLLUP (customer_id, repair_center),
  (date_received)
)

The query above will merge ROLLUP grouping levels with a grouping level based on date_received. As a result, we'll get the following grouping combinations:

LEAD

Exercise

Run the template query and note how many grouping levels are created.