A running cash balance

SQLHard15 min

Your task

Return the Cash entries in date order with the balance after each. Give booked_on, amount_cents and balance_after.

Tables

ledger_account
idINTEGERnameTEXTkindTEXT
1Cashasset
2Revenueincome
3Feesexpense
4Refundsexpense
entry
idINTEGERtxn_idINTEGERaccount_idINTEGERamount_centsINTEGERbooked_onTEXT
11001500002026-01-05
21002-500002026-01-05
31011-15002026-01-05
4101315002026-01-05
51021320002026-02-09
61022-320002026-02-09
More rows not shown