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

Accounts That Went Negative

Return accounts whose running balance fell below zero at any point, with the lowest balance reached. Order by account.

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

Join Shalyam Newsletter

Get exclusive insights with every issue: education, research and innovation news.

One email a week. Unsubscribe any time.