This document discusses using UNPIVOT, PIVOT and GROUP BY extensions in SQL to transform and summarize data in various ways. Specifically, it shows how to:
1) Use UNPIVOT to transform columns into rows and PIVOT to transform rows into columns.
2) Use GROUP BY with ROLLUP, CUBE and GROUPING SETS functions to generate subtotals and totals across multiple levels or dimensions of data.
3) Apply techniques like UNPIVOT, PIVOT and GROUP BY to real-world sales data to transform it into a spreadsheet-like format with rows, columns, subtotals and totals.