Interview practice question
Monthly cohort retention
Data Engineering · SQL · Intermediate
Build a cohort table showing, for customers grouped by first purchase month, how many purchased again in each later month.
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Find each customer's first purchase month as their cohort.
- Join orders back to get activity months.
- Compute month offset between activity and cohort month.
- Count distinct customers per cohort and offset.
- Divide by cohort size for retention percentage.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.