Write a SQL query to join program, finance, and operations tables to calculate monthly spend by region and flag regions where spend exceeds budget at Population Services International.
Use the reporting months available in operations for January and February 2025. Include months with no recorded finance amount as zero spend.
reporting_month, region, monthly_spend, monthly_budget, and budget_status.budget_status to EXCEEDS_BUDGET when spend is greater than budget, otherwise WITHIN_BUDGET.region, then reporting_month ascending.| Column | Type | Description |
|---|---|---|
| program_idPK | INT | Unique program identifier |
| program_name | VARCHAR(100) | Program name |
| region | VARCHAR(50) | Operational region |
| monthly_budget | DECIMAL(12,2) | Budget allocated to the program for one month |
| Column | Type | Description |
|---|---|---|
| finance_idPK | INT | Unique finance transaction identifier |
| program_id | INT | Referenced program |
| spend_date | DATE | Date of the recorded spend |
| amount | DECIMAL(12,2) | Spend amount, which may be missing |
| Column | Type | Description |
|---|---|---|
| operation_idPK | INT | Unique operational reporting record |
| program_id | INT | Referenced program |
| reporting_month | DATE | First day of the operational reporting month |
| operational_status | VARCHAR(30) | Operational status for the program month |