SQL Taskbook Level 1.5
Given a table:
| id | user_id | product_id | amount | date |
|---|---|---|---|---|
| 1 | 2 | 2 | 150.50 | 2020-03-17 |
| 2 | 3 | 2 | 200.60 | 2017-08-31 |
| 3 | 4 | 4 | 700.10 | 2011-05-03 |
| 4 | 5 | 3 | 300.40 | 2005-12-31 |
| 5 | 5 | 3 | 650.70 | 2000-12-02 |
Solve the following tasks for it:
Select all records from this table where user_id is equal to 5.
Select only the amount field from this table where user_id equals 5.
Select only the amount field from this table where product_id equals 2.
Select all records from this table where amount is greater than 200.
Select all records from this table where amount is less than 500.
Select all records from this table where amount is greater than or equal to 500.
Select all records from this table where date is equal to '2005-12-31'.
Select all records from this table where date is greater than '2003-12-31'.
Select all records from this table where date is less than '2005-12-31'.