SQL Taskbook Level 3.5

Given a table:

orders
id name price client_name client_id
1 Order#12211 120.00 Jorge 1 2023-07-03
2 Order#12323 50.00 John 2 2023-06-30
3 Order#45454 250.00 Ronny 3 2023-03-09
4 Order#12315 400.00 John 2 2023-02-18
5 Order#12316 99.00 Jorge 1 2023-01-08

Solve the following tasks for it:

Задание 1

Display customers whose total order amount is higher than the average order amount for the entire database. Include their names and total order amount.

Задание 2

Find customers who have more orders than the average for the entire database and who have at least one order in the current year. List their names and the number of orders.

Задание 3

Display orders where the order amount is greater than 100 dollars. Provide the order number, name, and amount.

Задание 4

Find orders where the order amount is greater than the average order amount for the current year. Provide the order number, name, and order amount.

Задание 5

Display orders placed by customers whose names begin with 'M' and end with 'a' and placed this year. Provide the order number and customer name.