SQL Taskbook Level 3.6

Given a table:

order_details
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:

Задание 1

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.

Задание 2

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.

Задание 3

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.

Задание 4

Find orders where the order amount is greater than 500 dollars. Provide the order number and order amount.

Задание 5

Display products where the average quantity of products in orders is greater than 5. Specify the product name, price, and average quantity.