Loading exercise…
Loading exercise…
Exercises are built for a keyboard. Read the task here, then open this page on a laptop to solve it.
Cohorts. A cohort is a group of customers who started at the same time: signup year, signup month or first-order month. Comparing cohorts on the same measure (share still buying, orders per customer) shows whether older customers behave differently from newer ones. Always keep the cohort's full size as the base, including customers who never bought.
select date_trunc('month', signup_date) as signup_month, count(*) as customers
from customers
where signup_date >= date '2025-01-01'
group by signup_month
order by signup_monthElena Petrova wants to know whether customers who signed up long ago are still buying in 2025, cohort by cohort.
Group customers into cohorts by signup year. Return cohort (the year), customers (all customers in it), buying_customers (those with at least one completed order) and pct_buying (buying_customers as a percent of customers, 2 decimals).
Loading the Brightline dataset…
Language
Full plan
SQL ✓ · Excel and Power BI also included
Cancel anytime · 14-day full refund · Secure payment by Stripe