SQL Practice Problems - Day 14 Focus: Advanced Grouping and Pivoting Operations 1 - Generate sales totals by category, by month, and overall total using GROUPING SETS. Input Tables: Sales_Transactions, Products Output: Category, Month, Total_Sales, Grouping_Level 2 - Create all possible combinations of sales aggregates by category, size, and color using CUBE. Input Tables: Sales_Transactions, Products Output: Category, Size, Color, Total_Sales 3 - Generate hierarchical sales aggregates by year, quarter, and month using ROLLUP. Input Table: Sales_Transactions Output: Year, Quarter, Month, Total_Sales 4 - Pivot monthly sales data to show categories as columns and months as rows. Input Tables: Sales_Transactions, Products Output: Month, Category1_Sales, Category2_Sales, Category3_Sales 5 - Unpivot wide inventory table with separate columns for each warehouse location. Input Table: Inventory_Wide Output: SKU_Code, Warehouse, Stock_Qty 6 - Use GROUPING SETS to show sales by category, by customer region, and combined. Input Tables: Sales_Transactions, Products, Customers Output: Category, Region, Total_Sales, Grouping_ID 7 - Create a CUBE operation for sales analysis by product category, size, and customer tier. Input Tables: Sales_Transactions, Products, Customers Output: Category, Size, Customer_Tier, Total_Sales 8 - Generate ROLLUP report for sales hierarchy: year → quarter → month → day. Input Table: Sales_Transactions Output: Year, Quarter, Month, Day, Total_Sales 9 - Pivot sales data to show monthly totals for each product category as separate columns. Input Tables: Sales_Transactions, Products Output: Year, Jan_Sales, Feb_Sales, Mar_Sales, ... 10 - Unpivot pricing table with different platform prices into normalized format. Input Table: Pricing_Wide Output: SKU_Code, Platform, Price 11 - Use GROUPING SETS to analyze sales by multiple dimensions with subtotals. Input Tables: Sales_Transactions, Products, Customers Output: Category, Size, Region, Total_Sales, Grouping_Text 12 - Create CUBE for comprehensive sales analysis across all dimension combinations. Input Tables: Sales_Transactions, Products, Customers Output: Category, Size, Color, Region, Total_Sales 13 - Generate ROLLUP for geographic hierarchy: country → region → city sales totals. Input Tables: Sales_Transactions, Customers Output: Country, Region, City, Total_Sales 14 - Pivot customer sales data to show spending by product category columns. Input Tables: Sales_Transactions, Products, Customers Output: Customer_ID, Category1_Spend, Category2_Spend, ... 15 - Unpivot seasonal sales data with quarters as columns into long format. Input Table: Seasonal_Sales_Wide Output: SKU_Code, Quarter, Sales_Amount