SQL Taskbook Level 4.1
Given a table:
| id | user_id | amount | payment_type | bonuses_increases | bonuses_decreases | created_at |
| 1 | 12355 | 80.50 | CARD | 0.85 | 0.00 | 2023-09-10 |
| 2 | 52421 | 1700.13 | CARD | 17.00 | 1000.00 | 2023-09-27 |
| 3 | 125355 | 214.34 | CARD | 2.14 | 50.00 | 2023-09-01 |
| 4 | 9392 | 596.00 | CASH | 5.96 | 0.00 | 2023-10-08 |
| 5 | 23511 | 800.18 | CASH | 8.00 | 0.00 | 2023-09-30 |
| 6 | 125355 | 120.18 | CARD | 1.20 | 50.18 | 2023-10-03 |
| 7 | 52421 | 1000.12 | CASH | 10.00 | 0.00 | 2023-09-20 |
| 8 | 125355 | 81.78 | CASH | 8.17 | 0.00 | 2023-09-25 |
| 9 | 52421 | 509.12 | CARD | 5.91 | 100.12 | 2023-10-07 |
| 10 | 125355 | 100.50 | CASH | 1.00 | 0.00 | 2023-10-08 |
Solve the following tasks for it:
Group all receipts by users and calculate the sum of receipts. Select the field 'user_id' and the sum as the field 'sum'.
Group all checks by users and calculate the sum of checks, also specify that the sum of users is greater than 500. Select the field 'user_id' And and 'sum'.
Group all checks by payment type. Select the payment type and the rounded amount of the checks.
Group all checks by payment type for checks that were created after '2023-10-01'. Select the payment type and rounded check amount.
Group all checks by payment type for checks that were created after '2023-09-20' and no later than '2023-10-01'. Select the payment type and rounded check amount.