Write a SQL query to analyze operational performance by joining orders, customers, and support tickets, then aggregating key metrics by month and segment.
Use the order month and customer segment as the reporting grain. Include support tickets opened in the same month for customers represented in the order data. Preserve segments with no matching tickets.
Output
- One row per order month and customer segment.
- Columns:
month, segment, order_count, total_order_value, customer_count, ticket_count, and resolved_ticket_count.
- Sort by month ascending, then segment ascending with NULL segments last.