Write a SQL query to analyze operational performance by joining incident, workflow, and KPI tables to identify the highest-impact bottlenecks.
Use the provided tables to evaluate monthly workflow impact and return only the three highest-impact workflows for each month.
workflow_id, workflow_name, period_start, incident_count, total_downtime_minutes, avg_severity, sla_gap_pct, throughput_gap_pct, impact_score, previous_month_score, and impact_rank.period_start, impact_rank, and workflow_id.| Column | Type | Description |
|---|---|---|
| workflow_idPK | INT | Unique workflow identifier |
| workflow_name | VARCHAR(100) | Operational workflow name |
| operational_area | VARCHAR(80) | Area responsible for the workflow |
| Column | Type | Description |
|---|---|---|
| incident_idPK | INT | Unique incident identifier |
| workflow_id | INT | Affected workflow |
| incident_ts | TIMESTAMP | Incident occurrence timestamp |
| severity | INT | Incident severity from 1 to 5 |
| downtime_minutes | INT | Operational downtime attributed to the incident |
| status | VARCHAR(20) | Incident lifecycle status |
| Column | Type | Description |
|---|---|---|
| kpi_idPK | INT | Unique KPI record identifier |
| workflow_id | INT | Measured workflow |
| period_start | DATE | First day of the KPI month |
| target_sla_pct | DECIMAL(5,2) | Monthly SLA target percentage |
| actual_sla_pct | DECIMAL(5,2) | Monthly achieved SLA percentage |
| target_throughput | INT | Monthly throughput target |
| actual_throughput | INT | Monthly achieved throughput |