Cash movement by month
SQLMedium11 min
Your task
For the Cash account, total the entries per calendar month. Return month as YYYY-MM and net_cents, earliest first.
Tables
ledger_account| idINTEGER | nameTEXT | kindTEXT |
|---|
| 1 | Cash | asset |
| 2 | Revenue | income |
| 3 | Fees | expense |
| 4 | Refunds | expense |
entry| idINTEGER | txn_idINTEGER | account_idINTEGER | amount_centsINTEGER | booked_onTEXT |
|---|
| 1 | 100 | 1 | 50000 | 2026-01-05 |
| 2 | 100 | 2 | -50000 | 2026-01-05 |
| 3 | 101 | 1 | -1500 | 2026-01-05 |
| 4 | 101 | 3 | 1500 | 2026-01-05 |
| 5 | 102 | 1 | 32000 | 2026-02-09 |
| 6 | 102 | 2 | -32000 | 2026-02-09 |
More rows not shown Model answerRun