Accounts That Went Into Overdraft
Medium
Banking & HR Case Studies
Return the account_ids whose running balance was negative at any point. Order by account_id.
Table schema
Transactions(id INT PRIMARY KEY, account_id INT, type VARCHAR(6), amount INT)Sample data
id | account_id | type | amount
1 | 1 | credit | 50
2 | 1 | debit | 80
3 | 1 | credit | 100
4 | 2 | credit | 100
5 | 2 | debit | 40
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.