SQL Taskbook Level 1.4
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 or 4.
Select only the amount field from this table where user_id is equal to 5 or 6.
Select all records from this table where amount is greater than 200 or product_id is equal to 1.
Select all records from this table where amount is less than 500 or user_id is equal to 5.
Select all records from this table where amount is greater than or equal to 500 or where user_id is greater than 2.
Select all records from this table where date is equal to '2005-12-31' or date is equal to '2020-03-17'.
Select all records from this table where date is greater than '2003-12-31' or id is greater than 1.
Select all records from this table where date is less than '2005-12-31' or date is greater than '2001-01-01'.
Select all records from this table where date is less than '2005-12-31' or amount is greater than 600.
Select all records from this table where product_id is equal to 1 or 2 or date is greater than '2020-01-01'.