Hard
Window Functions
Pro Challenge

Running Account Balance with Same-Time Transactions

Calculate the running balance for every posted transaction using signed amount (credits positive, debits negative). Within an account, order by transacted_at then transaction_id; this ID rule controls same-time transactions. Return account_id, transaction_id, transacted_at, amount and running_balance. Return columns: account_id, transaction_id, transacted_at, amount, running_balance.

Preparing the interactive SQL workspace...

Challenge overview

What you will practice

Calculate the running balance for every posted transaction using signed amount (credits positive, debits negative). Within an account, order by transacted_at then transaction_id; this ID rule controls same-time transactions. Return account_id, transaction_id, transacted_at, amount and running_balance. Return columns: account_id, transaction_id, transacted_at, amount, running_balance.

Difficulty
Advanced
SQL concept
Window Functions