Explain how you would use window functions to analyze churn rate for Navi’s lending customers.
Use the provided Navi lending customer and monthly activity data. Return one row per activity month, including customers who were active in the previous observed month as the churn denominator.
activity_month, prior_active_customers, churned_customers, churn_rate_percentactivity_month ascending| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique Navi lending customer identifier |
| customer_name | VARCHAR(100) | Customer name |
| customer_segment | VARCHAR(30) | Customer lending segment |
| Column | Type | Description |
|---|---|---|
| activity_idPK | INT | Unique monthly activity record identifier |
| customer_id | INT | References lending_customers.customer_id |
| activity_month | DATE | First day of the activity month |
| is_active | BOOLEAN | Whether the customer was active during the month |