Skip to main content
All Problems
medium0% acceptance

Monthly New Account Trend with CTE

The growth team wants a monthly trend of new account openings. Use a CTE to extract the month from opened_at and count accounts per month. In the main query, also compute a running total of accounts opened using a window function. Return month, monthly_count, and cumulative_count. Sort by month.

Schema

🔑idINT
🔗customer_idINT
account_typeTEXT
balanceREAL
currencyTEXT
opened_atTEXT
statusTEXT
postgresql

Run your query to see results

Press Ctrl + Enter to execute