CREATE TABLE transactions (id INTEGER PRIMARY KEY, account_id INTEGER NOT NULL REFERENCES accounts(id), kind TEXT NOT NULL CHECK (kind IN ('deposit', 'withdrawal')), amount INTEGER NOT NULL, txn_date TEXT NOT NULL);Example rows of the transactions table| id | account_id | kind | amount | txn_date |
|---|
| 1 | 1 | deposit | 2000 | 2026-04-01 |
| 2 | 1 | withdrawal | 500 | 2026-04-01 |
| 3 | 1 | withdrawal | 3000 | 2026-04-03 |
| 4 | 1 | deposit | 1000 | 2026-04-04 |
| 5 | 2 | deposit | 800 | 2026-04-02 |
| 6 | 2 | withdrawal | 1000 | 2026-04-03 |
| 7 | 2 | deposit | 400 | 2026-04-03 |
| 8 | 3 | withdrawal | 12000 | 2026-04-05 |