Given these two database tables, write a SQL query to find the top three performing metrics for the last quarter.
Use the last completed calendar quarter and treat the average recorded performance score as the metric's performance. Return exactly three metrics when at least three have valid scores.
metric_name, average_performance, and performance_rank| Column | Type | Description |
|---|---|---|
| metric_idPK | INT | Unique metric identifier |
| metric_name | VARCHAR(100) | Metric name |
| metric_category | VARCHAR(50) | Optional metric category |
| Column | Type | Description |
|---|---|---|
| result_idPK | INT | Unique performance result identifier |
| metric_id | INT | Referenced metric identifier |
| recorded_at | DATE | Date on which the score was recorded |
| performance_score | DECIMAL(8,2) | Observed performance score |
| source_system | VARCHAR(50) | System that supplied the result |