Write a SQL query to analyze monthly operational costs by department and identify the top three cost centers each month.
Use the provided operational cost, cost center, and department data. Include only cost centers associated with a department and treat missing cost amounts as zero.
Output
- One row per selected cost center and month.
- Columns:
cost_month, department_name, cost_center_name, monthly_cost, and monthly_rank.
- Include the three highest-cost centers for each month, ordered by month and monthly rank. Break equal-cost ties by ascending cost center ID.