SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Cohort Analysis - Customer Retention by Signup Month

Build mastery in Date Operations with this scenario-based SQL challenge and live execution support.

Problem Statement

Group customers into cohorts by their first-order month, then measure how many remain active in each subsequent month. months_since_signup uses real year*12+month arithmetic. Return cohort_month, months_since_signup, active_customers, cohort_size, retention_rate — ordered by cohort_month, months_since_signup.

Relevant Tables

orders

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: