About the “Net New MRR Bridge: New, Expansion, and Contraction” SQL Problem
Business Scenario
SaaS financial reporting decomposes recurring revenue into three distinct movements: new acquisition MRR, expansion MRR from upgrades, and contraction MRR from downgrades.
Expected Output & Criteria
Single row summary showing new_mrr, expansion_mrr, contraction_mrr, and net_new_mrr.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE mrr_movements (
movement_id INT PRIMARY KEY,
account_id INT NOT NULL,
movement_type VARCHAR(20) NOT NULL,
movement_amount NUMERIC(10, 2) NOT NULL
);Target SQL Clauses & Operators
WITHSUM
Want more CTEs practice?
Explore the full syllabus of 12 exercises, syntax guides, and interview pitfalls.