SQL - Advanced Query Patterns
Given the table
What will be the result of this query?
SalesData with columns Product, Q1, Q2, Q3 and data:Product | Q1 | Q2 | Q3 --------|----|----|--- Pen | 10 | 15 | 20 Book | 5 | 7 | 8
What will be the result of this query?
SELECT Product, Quarter, Amount FROM SalesData UNPIVOT (Amount FOR Quarter IN (Q1, Q2, Q3));
