Write a query to find the top three highest-performing oil wells per region using window functions.
Treat performance as the total recorded barrels produced by each well. Use the provided wells and well_production tables.
region, well_id, well_name, total_production, and performance_rank.well_id.| Column | Type | Description |
|---|---|---|
| well_idPK | INT | Unique identifier for the oil well |
| region | VARCHAR(100) | Operational region containing the well |
| well_name | VARCHAR(150) | Name assigned to the well |
| Column | Type | Description |
|---|---|---|
| production_idPK | INT | Unique production record identifier |
| well_id | INT | Referenced oil well |
| production_date | DATE | Date of the production measurement |
| barrels | NUMERIC(12,0) | Barrels produced during the measurement period |