Explain how you would use SQL to extract actionable insights from a messy, multi-source dataset.
Use the provided customer, sales order, and support ticket tables. Consider inconsistent status values, missing amounts, unmatched source records, inactive customers, and customers with no activity.
Output
- One row per active customer.
- Include
customer_id, customer_name, region, total_revenue, completed_order_count, active_ticket_count, high_priority_active_tickets, last_order_date, and action_status.
- Include only orders from 2025-01-01 through 2025-03-31, include customers without matching orders or tickets, and sort by
total_revenue descending, then customer_id ascending.