mahir_data
mediumGoTo · aggregationPro

Pivot quarterly sales into columns

Sales are stored one row per region per quarter. Turn this into a wide report: one row per region, with separate columns for Q1 and Q2 totals.

Return region, q1_total, and q2_total.

Schema

sales
idINT
regionTEXT
quarterTEXT
amountNUMERIC

Pro

The example input, expected output, and walkthrough for this question unlock with a Pro plan.

Pro

This is a Pro question

Premium practice questions unlock with a Pro plan. The full solution, expected output, and grading are available to Pro members.

See Pro plans