Quadrint analysts need a product-level revenue trend for a reporting surface such as the Mission Operations Dashboard. Write a PostgreSQL query that summarizes completed sales by product and day, then calculates each product's running revenue total.
sale_status = 'completed' and matching products.daily_revenue.running_total.| Column | Type | Description |
|---|---|---|
| product_idPK | INTEGER | Unique product identifier |
| product_name | VARCHAR(120) | Quadrint product name |
| lifecycle_status | VARCHAR(20) | Current product lifecycle status |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INTEGER | Unique sale identifier |
| product_id | INTEGER | Product associated with the sale |
| sale_date | DATE | Date on which the sale occurred |
| amount | NUMERIC(12,2) | Revenue amount |
| sale_status | VARCHAR(20) | Sale processing status |