SQL Taskbook Level 5.10
The tables are given:
| id | user_id | amount | payment_type | bonuses_increases | bonuses_decreases | created_at | store_id |
| 1 | 3 | 80.50 | CARD | 0.85 | 0.00 | 2023-09-10 | 2 |
| 2 | 2 | 1700.13 | CARD | 17.00 | 1000.00 | 2023-09-27 | 2 |
| 3 | 5 | 214.34 | CARD | 2.14 | 50.00 | 2023-09-01 | 1 |
| 4 | 1 | 596.00 | CASH | 5.96 | 0.00 | 2023-10-08 | 1 |
| 5 | 3 | 800.18 | CASH | 8.00 | 0.00 | 2023-09-30 | 2 |
| 6 | 3 | 120.18 | CARD | 1.20 | 50.18 | 2023-10-03 | 2 |
| 7 | 2 | 1000.12 | CASH | 10.00 | 0.00 | 2023-09-20 | 1 |
| 8 | 1 | 81.78 | CASH | 8.17 | 0.00 | 2023-09-25 | 1 |
| 9 | 4 | 509.12 | CARD | 5.91 | 100.12 | 2023-10-07 | 1 |
| 10 | 5 | 100.50 | CASH | 1.00 | 0.00 | 2023-10-08 | 2 |
| id | name | age | city |
| 1 | Aaron | 43 | New-York |
| 2 | Marina | 20 | Minsk |
| 3 | Max | 23 | Kyiv |
| 4 | Catherine | 30 | Berlin |
| 5 | Andrew | 18 | Berlin |
| id | name |
|---|---|
| 1 | First store |
| 2 | Seconds store |
Solve the following tasks for them:
Get a list of users and their transactions. And also the name of the store where this transaction was made.
Get a list of transaction IDs and usernames that made them for the first 5 transactions. And also the name of the store where the transaction was made.
Get the usernames and transaction IDs that paid for purchases with the card. And also the name of the store where the transaction was made.
Get the usernames and transaction IDs that paid for purchases with cash. And also the name of the store where the transaction was made.