About the “Cohort Cumulative Expansion Revenue Trajectory” SQL Problem
Business Scenario
SaaS venture investors track net dollar retention. For each customer signup cohort, finance wants to observe cumulative expansion revenue accumulated over consecutive operating months.
Expected Output & Criteria
Monthly expansion MRR alongside cumulative cohort expansion total.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE cohort_expansions (
cohort_name VARCHAR(20) NOT NULL,
activity_month DATE NOT NULL,
expansion_mrr NUMERIC(10, 2) NOT NULL,
PRIMARY KEY (cohort_name, activity_month)
);Target SQL Clauses & Operators
SUMOVERPARTITION BY
Want more Window Functions practice?
Explore the full syllabus of 14 exercises, syntax guides, and interview pitfalls.