About the “MRR Breakdown by Subscription Tier” SQL Problem
Business Scenario
The Chief Revenue Officer needs a summary of active revenue distribution across customer tiers. Tiers with fewer than 2 active accounts should be filtered out to protect customer confidentiality.
Expected Output & Criteria
Aggregate table showing tier, total_mrr, active_customers, and avg_seats for tiers with >= 2 active accounts.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE customer_accounts (
account_id INT PRIMARY KEY,
company_name VARCHAR(100) NOT NULL,
tier VARCHAR(30) NOT NULL,
status VARCHAR(20) NOT NULL,
mrr NUMERIC(10, 2) NOT NULL,
seat_count INT NOT NULL
);Target SQL Clauses & Operators
Want more Aggregations practice?
Explore the full syllabus of 12 exercises, syntax guides, and interview pitfalls.