Write a SQL query to analyze monthly operational spend by region, compare it to budget, and flag variances greater than 10%.
Use the provided regional budget and operational spend data. Treat a variance as the percentage difference between actual spend and budget, using the budget as the denominator. Include budgeted region-months even when no spend exists.
Output
- One row per budgeted region and month
- Columns:
region_name, spend_month, actual_spend, budget_amount, variance_amount, variance_pct, and variance_flag
- Flag rows when the absolute variance exceeds 10%; order by region name and month