About the “Day-over-Day Account Balance Net Delta” SQL Problem
Business Scenario
Treasury risk operations track daily closing cash positions across merchant accounts, computing the net dollar change compared to the previous day's closing balance.
Expected Output & Criteria
Daily closing balances with day-over-day net cash variance.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMCREATE TABLE daily_account_snapshots (
account_id INT NOT NULL,
snapshot_date DATE NOT NULL,
closing_balance NUMERIC(12, 2) NOT NULL,
PRIMARY KEY (account_id, snapshot_date)
);Target SQL Clauses & Operators
Want more Window Functions practice?
Explore the full syllabus of 18 exercises and syntax guides.