Tell me about a time you were asked to solve various problems in SQL.
For this exercise, use the provided Insurify-style operational tables and write one query that answers the requested business questions from the same dataset. Keep the result set compact and deterministic.
Output
- One row per customer who has at least one completed quote and at least one policy event.
- Return
customer_id, customer_name, completed_quotes, policy_events, first_completed_quote_date, last_policy_event_date, and days_between_first_and_last.
- Include only customers whose completed quotes are greater than zero and whose policy events are greater than zero.
- Sort by
days_between_first_and_last descending, then customer_id ascending.