TransUnion needs a customer-level view of credit utilization trends for analytics and risk monitoring. Write a PostgreSQL query that aggregates account snapshots by month, then uses window functions to calculate cumulative and rolling utilization metrics.
| Column | Type | Description |
|---|---|---|
| customer_idPK | INTEGER | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| Column | Type | Description |
|---|---|---|
| snapshot_idPK | INTEGER | Unique snapshot identifier |
| customer_id | INTEGER | Customer associated with the snapshot |
| snapshot_date | DATE | Date when the balance and limit were recorded |
| balance | NUMERIC(12,2) | Outstanding revolving balance |
| credit_limit | NUMERIC(12,2) | Total reported credit limit |