Your question is SQL Sales Metrics With Edge Cases. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Netflix wants a monthly sales view covering every retail store, including months in which a store had no sales. Write a PostgreSQL query for January through March 2025.
| Column | Type | Description |
|---|---|---|
| store_idPK | INT | Unique store identifier |
| store_name | VARCHAR(100) | Name of the store |
| region | VARCHAR(50) | Geographic region containing the store |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sale identifier |
| store_id | INT | Store associated with the sale |
| sale_date | DATE | Date on which the sale occurred |
| amount | NUMERIC(10,2) | Sale amount |
| sale_channel | VARCHAR(30) | Channel used for the sale |