FunctionRacerProblemsRace

Running Balance

MediumSQLSQLite

deposits has one row per day, and a negative amount is money taken out. Return every day with its amount and running: the sum of all amounts up to and including that day. Earliest day first.

Example 1

deposits
dayamount
2026-01-05100
2026-01-0250
2026-01-09-30
2026-01-0720
returns
dayamountrunning
2026-01-025050
2026-01-05100150
2026-01-0720170
2026-01-09-30140

Constraints

Race itor take your time

Write it in your browser, against the clock. The model query, with a note on each piece of it, comes after.

More SQL problems