NovaPlay wants to measure how well each acquisition channel retains new users after signup. Write a PostgreSQL query to calculate 30-day retention by acquisition channel.
A user is considered retained if they have at least one activity event on or after signup_date + 30 days and on or before signup_date + 60 days. Use each user's acquisition channel from the acquisitions table.
Requirements
- Return one row per acquisition channel.
- For each channel, calculate:
- total signed-up users
- retained users
- 30-day retention rate as a percentage rounded to 2 decimals
- Include users even if they have no matching acquisition row; label those as
'Unknown'.
- Order results by retention rate descending, then channel name ascending.