Your retention team wants to identify churned customers - those who placed an order last year but did not place any order this year. Using the orders_2023 and orders_2024 tables, return the distinct customer_id of every customer who ordered in 2023 but not in 2024. Sort by customer_id.
orders_2023
| column | type |
|---|---|
| customer_id | INTEGER |
| total | NUMERIC |
orders_2024
| column | type |
|---|---|
| customer_id | INTEGER |
| total | NUMERIC |
orders_2023
| customer_id | total |
|---|---|
| 101 | 250.00 |
| 102 | 180.00 |
| 103 | 95.00 |
orders_2024
| customer_id | total |
|---|---|
| 102 | 310.00 |
| 104 | 60.00 |
| customer_id |
|---|
| 101 |
| 103 |
Customers 101 and 103 ordered in 2023 but not in 2024 - they churned. Customer 102 ordered in both years (retained). Customer 104 is new in 2024 and was never in 2023, so they are not churned.