How would you write complex queries to answer a business question?
Using the supplied customer, order, order item, and support ticket data, produce a monthly performance view for active customers from January through March 2025. Include completed-order revenue, month-over-month revenue change, regional revenue rank, a three-month rolling revenue total, and support ticket volume.
Output
- One row per active customer and calendar month.
- Columns:
customer_id, customer_name, region, month, monthly_revenue, prior_month_revenue, revenue_growth_pct, regional_monthly_rank, rolling_3_month_revenue, and support_ticket_count.
- Include months with no revenue as zero, order by
month, region, regional_monthly_rank, and customer_id.