Loading problem...
A retail pricing warehouse stores one row per (product, store) offer. Analysts need a fixed-format report that places each store's price in its own column so downstream dashboards can compare stores side by side.
Table: products
Data guarantees:
Task:
Output requirements:
Supported submission environments:
products:
| product_id | store | price |
|------------|--------|-------|
| 0 | store1 | 95 |
| 0 | store3 | 105 |
| 0 | store2 | 100 |
| 1 | store1 | 70 |
| 1 | store3 | 80 |[
{"product_id":0,"store1":95,"store2":100,"store3":105},
{"product_id":1,"store1":70,"store2":null,"store3":80}
]Product 0 has all three store prices. Product 1 has no store2 row, so store2 is null.
products:
| product_id | store | price |
|------------|--------|-------|
| 11 | store2 | 45 |
| 11 | store1 | 30 |
| 12 | store3 | 90 |
| 13 | store2 | 0 |[
{"product_id":11,"store1":30,"store2":45,"store3":null},
{"product_id":12,"store1":null,"store2":null,"store3":90},
{"product_id":13,"store1":null,"store2":0,"store3":null}
]Rows may be unordered, and a zero price is valid data that must be preserved.
products:
| product_id | store | price |
|------------|--------|-------|
| (no rows) |[]With no product-store rows, there are no products to report.
Constraints