About the “Real-Time Account Ledger Running Balance” SQL Problem
Business Scenario
Core banking ledgers process deposits (positive credits) and debits (negative withdrawals). Financial auditors require computing the exact balance of each bank account after every transaction.
Expected Output & Criteria
Ledger lines showing running balance per account.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE account_ledger_lines (
line_id INT PRIMARY KEY,
account_id INT NOT NULL,
amount NUMERIC(10, 2) NOT NULL
);Target SQL Clauses & Operators
SUMOVERPARTITION BY
Want more Window Functions practice?
Explore the full syllabus of 14 exercises, syntax guides, and interview pitfalls.