SSIS questions Star/ Snowflake Schema Difference
Write a PostgreSQL query against the provided dimensional tables to summarize outstanding loan balances by reporting month and region. The query should preserve fact rows whose branch or region mapping is missing, exclude reporting months outside the first quarter of 2026, and exclude zero-total regions.
Output
- One row per reporting month and region
- Columns:
region_name, reporting_month, total_outstanding_balance, reporting_branches
- Sort by month ascending, then region name ascending
Output details
- Represent missing region mappings as
Unassigned in region_name.
- Treat NULL
outstanding_balance values as zero before summing.
- Count distinct
branch_id values for reporting_branches.
- Include
2026-01-01 and exclude 2026-04-01 when filtering snapshot dates.
- Format
reporting_month as YYYY-MM.