Instruction
Perfect! Let's try another exercise.
Exercise
Find the percentage of churned customers in monthly signup cohorts. Show the following columns: Year, Month, AllCustomers, ChurnedCustomers, and ChurnedPercentage. 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 ChurnedPercentage column as:
COUNT(CASE WHEN DATEDIFF(Day, LastOrderDate, GETDATE()) > 60 THEN CustomerID END) * 100.0 / COUNT(CustomerID) AS




