Back to problems

Write SQL for cohort retention and ARPU

SQL · Onemain Financial · Hard

Write one PostgreSQL query that builds signup cohorts by month and, for every cohort, reports both the fraction of its members who were active on day 30 and the average revenue those members generated during their first 30 days. A user belongs to the cohort of the calendar month containing their signup_date, obtained with date_trunc('month', signup_date). A member is counted as D30-retained when at least one event exists whose event_ts is exactly the calendar day signup_date…

Checking your access…