Build an Excel-style table: products as rows, months as columns
The CFO is used to an Excel-style grid: product in rows, months in columns, sum in the cell. Your data is in «long» form — every row in sales is «product, month, amount».
Pivot it into «wide» form: for every product compute total sales separately for January 2024, February 2024, and March 2024. Show the product and three columns with the per-month sums. Sort by product.
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.
| product | m_2024_01 | m_2024_02 | m_2024_03 |
|---|---|---|---|
| A | 100.00 | 150.00 | 120.00 |
| B | 80.00 | 90.00 | 110.00 |
| C | 60.00 | 70.00 | 85.00 |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in