How would you approach designing a dashboard or report for executive stakeholders at Gartner to drive strategic decisions?
Using the supplied Gartner account and engagement tables, write a SQL query that produces a quarterly executive KPI report by client segment. Include only completed engagements from 2025 and calculate the requested metrics from the available data.
segment, quarter_start, active_clients, completed_engagements, total_revenue, avg_satisfaction, revenue_growth_pct.segment ascending, then quarter_start ascending. The first quarter for each segment should have a NULL growth percentage.active_clients as distinct account IDs with completed engagements in each segment and quarter.completed_engagements as qualifying engagement rows, and calculate total_revenue as their revenue sum.avg_satisfaction to two decimal places.revenue_growth_pct against the previous reported quarter's total_revenue for the same segment.revenue_growth_pct as NULL when previous revenue is NULL or zero, otherwise round it to two decimal places.segment values last while retaining ascending segment and quarter ordering.| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique Gartner client account identifier |
| account_name | VARCHAR(120) | Client account name |
| segment | VARCHAR(60) | Client market segment |
| Column | Type | Description |
|---|---|---|
| engagement_idPK | INT | Unique engagement identifier |
| account_id | INT | Client account associated with the engagement |
| engagement_date | DATE | Engagement completion or scheduled date |
| status | VARCHAR(30) | Engagement lifecycle status |
| revenue | DECIMAL(12,2) | Revenue attributed to the engagement |
| satisfaction_score | DECIMAL(3,2) | Client satisfaction score from 1.00 to 5.00 |