Write a SQL query to identify customers who have churned after their third box.
Use the customers and boxes tables. Treat a customer as qualifying when their third box was delivered before their recorded churn timestamp and their subscription status is churned.
customer_id, customer_name, third_box_date, and churned_atchurned_at ascending, then customer_id ascending| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer's name |
| subscription_status | VARCHAR(20) | Current subscription status |
| churned_at | TIMESTAMP | Timestamp when the customer churned |
| Column | Type | Description |
|---|---|---|
| box_idPK | INT | Unique box record identifier |
| customer_id | INT | Customer who received or was assigned the box |
| box_number | INT | Sequential box number in the subscription |
| delivered_at | DATE | Date the box was delivered |
| delivery_status | VARCHAR(20) | Delivery state of the box |