Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Running Balance per Account

Return each transaction with the running balance of its account in id order. Order by id.

Table schema

Transactions(id INT PRIMARY KEY, account VARCHAR(5), amount INT)

Sample data

id | account | amount
1 | A | 100
2 | A | -30
3 | B | 50
4 | A | -90
5 | B | -20

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.