Instruction
Perfect! Let's try another exercise.
Exercise
Find the percentage of churned customers in monthly signup cohorts. Show the following columns: year, month, all_customers, churned_customers, and churned_percentage. Define churned customers as those who have not ordered anything in the last 60 days. Sort the results by year and month.
Stuck? Here's a hint!
Calculate the churned_percentage column as:
COUNT(CASE WHEN CURRENT_DATE - last_order_date > INTERVAL '60' day THEN customer_id END) * 100.0 / COUNT(customer_id) AS churned_percentage




