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
| id | INT |
| region | TEXT |
| quarter | TEXT |
| amount | NUMERIC |
Basic
The example input, expected output, and walkthrough for this question unlock with a Basic plan.
Basic
The reference solution and walkthrough for this question unlock with a Basic plan.
See Basic plansRM 25/mo · cancel anytime
Basic
This is a Basic question
Premium practice questions unlock with a Basic plan. The full solution, expected output, and grading are available to Basic members.
RM 25/mo · cancel anytime