By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Records: 4 Duplicates: 0 Warnings: 0
Records: 5 Duplicates: 0 Warnings: 0
Records: 5 Duplicates: 0 Warnings: 0
Records: 3 Duplicates: 0 Warnings: 0
Records: 3 Duplicates: 0 Warnings: 0
Records: 4 Duplicates: 0 Warnings: 0
| user_id | name | account_bal |
|---|---|---|
| 1 | Wells | -5 |
| 2 | James | 100 |
| 3 | Joy | 10 |
| 4 | Mumbi | -300 |
| id | user_id | amount | date |
|---|---|---|---|
| 3 | 3 | 5 | 2021-04-25 |
| 4 | 4 | 5 | 2021-04-25 |
| 1 | 1 | 5 | 2021-04-26 |
| 2 | 3 | 10 | 2021-04-26 |
| 5 | 3 | 73 | 2021-05-06 |
| id | user_id | amount_tendered | date |
|---|---|---|---|
| 5 | 4 | 50 | 2021-04-25 |
| 2 | 2 | 10 | 2021-04-26 |
| 3 | 3 | 15 | 2021-04-26 |
| 1 | 1 | 5 | 2021-04-27 |
| 4 | 3 | 17 | 2021-04-27 |
| council_id | name |
|---|---|
| 1 | a |
| 2 | b |
| 3 | c |
| market_id | name | council_id |
|---|---|---|
| 1 | x | 3 |
| 2 | y | 1 |
| 3 | z | 2 |
| id | market_id | user_id |
|---|---|---|
| 1 | 1 | 3 |
| 2 | 2 | 2 |
| 3 | 3 | 1 |
| 4 | 3 | 4 |
| council_id | date | total_overdraft |
|---|---|---|
| 1 | 2021-04-01 | 0 |
| 2 | 2021-04-01 | -305 |
| 3 | 2021-04-01 | 0 |
| 2 | 2021-04-25 | -350 |
| 2 | 2021-04-26 | -345 |
| 2 | 2021-04-27 | -350 |
| 3 | 2021-04-27 | -7 |
| 3 | 2021-05-06 | 0 |
| council_id | date | total_overdraft |
|---|---|---|
| 1 | 2021-04-01 | 0 |
| 2 | 2021-04-01 | -260 |
| 3 | 2021-04-01 | -46 |
| 2 | 2021-04-25 | -305 |
| 3 | 2021-04-25 | -41 |
| 2 | 2021-04-26 | -300 |
| 3 | 2021-04-26 | -46 |
| 2 | 2021-04-27 | -305 |
| 3 | 2021-04-27 | -63 |
| 3 | 2021-05-06 | 0 |