How would you use SQL and Python to analyze data, and how would you present insights in Power BI?
Use the provided customer, loan, and payment data. Produce a monthly payment-performance dataset that can be validated with Python and loaded into Power BI.
Output
- One row per customer region and payment month.
- Return
region, payment_month, payment_attempts, successful_payments, collected_amount, and collection_rate_pct.
- Include every month with payment attempts, including months with no successful payments. Sort by
region, then payment_month.
Output details
- Restrict
payment_date to 2025-01-01 inclusive through 2025-04-01 exclusive.
- Represent each
payment_month as the first day of its month.
- Treat missing regions as
Unknown.
- Count only payments with status
SUCCESS as successful payments and sum their amounts for collected_amount.
- Round
collection_rate_pct to two decimal places, using successful payments divided by payment attempts times 100.
- Sort
region and then payment_month in ascending order.