Your question is Compare Rider Retention by Signup Cohort. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Write a PostgreSQL query to compare month-1 retention across monthly rider signup cohorts. A rider belongs to the cohort of their signup_date month, and is considered retained if they complete at least one ride in the next calendar month. Return cohort month, cohort size, retained riders, and retention rate.
| Column | Type | Description |
|---|---|---|
| rider_id | ||
| rider_name | ||
| signup_date | ||
| city |
| Column | Type | Description |
|---|---|---|
| ride_id | ||
| rider_id | ||
| ride_date | ||
| status | ||
| fare_amount |
status = 'completed'.