Pattern 15· SQL & Querying

Reshaping — pivot & unpivot

Conditional-aggregation pivot, UNION-ALL/lateral unpivot, wide-vs-long as a modeling choice, dynamic-column limits.

The traps in this pattern

Ready to practise?

Run graded Reshaping — pivot & unpivot problems in your browser — 4 traps covered here.

Practise these problems →