Your question is Running Totals of Daily Revenue. 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.
Fashion Nova’s commerce analytics team needs a daily revenue trend for completed orders. Write a PostgreSQL query that aggregates order-item revenue by order date and calculates the cumulative revenue over time.
completed status.quantity * unit_price, treating NULL or missing monetary values as zero.| Column | Type | Description |
|---|---|---|
| order_idPK | INTEGER | Unique order identifier |
| order_date | DATE | Date the order was placed |
| status | VARCHAR(20) | Order lifecycle status |
| Column | Type | Description |
|---|---|---|
| order_item_idPK | INTEGER | Unique order-line identifier |
| order_id | INTEGER | Related order identifier |
| product_sku | VARCHAR(30) | Fashion Nova product SKU |
| quantity | INTEGER | Units purchased |
| unit_price | NUMERIC(10,2) | Price per unit |