SQL Taskbook Level 3.6
Given a table:
| id | order_id | price | amount | product_name | product_id |
| 1 | 12211 | 900.00 | 3 | Monitor | 1 |
| 2 | 12323 | 700.00 | 7 | Tablet | 5 |
| 3 | 45454 | 1600.00 | 9 | Smartphone | 4 |
| 4 | 12315 | 400.00 | 20 | Mouse | 3 |
| 5 | 12316 | 150.00 | 5 | Keyboard | 2 |
Solve the following tasks for it:
Display products with an average quantity of products in orders greater than 4 and a price lower than the average price in the entire database. Specify the product name, average quantity, and price.
Find orders where the number of products is greater than 8 and the order amount is higher than the average order amount. Provide the order number, number of products, and order amount.
Display products where the average quantity of products in orders is greater than 3 and the average discount is greater than 10%. Specify the product name, average quantity, and average discount.
Find orders where the order amount is greater than 500 dollars. Provide the order number and order amount.
Display products where the average quantity of products in orders is greater than 5. Specify the product name, price, and average quantity.