How would you answer SQL questions on joins and CTEs, and Python questions using pandas for string manipulation?
For the SQL portion, write a query that analyzes merchants, customers, payments, and payment events for Q1 2025. The result should combine payment totals with repeat-customer and month-over-month metrics.
Output
- One row per merchant, including merchants without qualifying payments.
- Columns:
merchant_name, total_success_amount, active_customers, repeat_customers, latest_success_date, and avg_monthly_change.
- Include only successful payments from Q1 2025 for payment metrics. Order by
total_success_amount descending, then merchant_name ascending.