← All SQL interview questions

Month-1 retention rate by signup cohort

HardCTEsSwiggyMeeshoPayPal

Growth reports the share of each monthly signup cohort that came back and transacted in the following calendar month.

app_users holds signed_up_on; app_activity holds one row per active day. Using CTEs, return cohort_month, cohort_size, retained_users and retention_pct (retained ÷ cohort size × 100, rounded to 1 decimal).

Sample data

Table: app_users

12 row(s) · showing first 8

user_idINTuser_emailTEXTsigned_up_onDATE
1ira@example.in2026-01-05
2devansh@example.in2026-01-11
3nikhil@example.in2026-01-19
4mahima@example.in2026-01-26
5yusuf@example.in2026-02-03
6prerna@example.in2026-02-09
7sagar@example.in2026-02-17
8rhea@example.in2026-02-24

Table: app_activity

19 row(s) · showing first 8

activity_idINTuser_idINTactive_onDATE
112026-01-06
212026-02-14
322026-01-12
422026-02-02
532026-01-20
642026-01-27
742026-03-05
852026-02-04

Practising alone only goes so far — our live cohorts pair SQL depth with dashboards, agentic analytics projects and mock interviews.

Explore the program