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

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

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