Write a SQL query to find the top three highest-grossing product lines in the last quarter, partitioning by region.
Assume the last quarter is Q2 2025, from April 1 through June 30. Include completed sales only. Ties at the third position should be included.
region_name, product_line_name, total_revenue, and revenue_rank.region_name, revenue_rank, then product_line_name.| Column | Type | Description |
|---|---|---|
| region_idPK | INT | Unique region identifier |
| region_name | VARCHAR(100) | Business region name |
| Column | Type | Description |
|---|---|---|
| product_line_idPK | INT | Unique product-line identifier |
| product_line_name | VARCHAR(150) | Product-line name |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sales transaction identifier |
| region_id | INT | Region associated with the sale |
| product_line_id | INT | Product line associated with the sale |
| sale_date | DATE | Date of the sale |
| quantity | INT | Units sold |
| unit_price | NUMERIC(12,2) | Price per unit |
| status | VARCHAR(30) | Transaction status |