Jerry wants to identify the products generating the most sales on its customer and policy surfaces. Write a PostgreSQL query that returns the top five products by sales during the rolling 12-month period ending on August 29, 2026.
status = 'completed'.DATE '2025-08-29' through DATE '2026-08-29'.quantity * unit_price, treating a missing unit price as zero.product_id ascending.product_name and total_sales.| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique product identifier |
| product_name | VARCHAR(100) | Jerry product name |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| order_date | DATE | Date the order was placed |
| status | VARCHAR(20) | Order lifecycle status |
| Column | Type | Description |
|---|---|---|
| order_item_idPK | INT | Unique order-line identifier |
| order_id | INT | References orders.order_id |
| product_id | INT | References products.product_id |
| quantity | INT | Number of units purchased |
| unit_price | NUMERIC(10,2) | Price per unit at checkout |