SQL Taskbook Level 3.7
Given a table:
| id | name | surname | total_sum | total_orders | last_activity | |
| 1 | Ioann | Red | 12000.00 | 60 | 2023 | ioann.red@gmail.com |
| 2 | Aaron | Gold | 700.00 | 7 | 2013 | aaron.gold@gmail.com |
| 3 | Brian | Tricky | 1600.00 | 9 | 2023 | brian-tricky@gmail.com |
| 4 | John | Bread | 20.000 | 144 | 2023 | NULL |
Solve the following tasks for it:
Find customers whose total order value exceeds 10,000 dollars and who have not placed an order this year. List their first name, last name, and total order value.
Display customers whose last order date is more than 5 years ago and who have made more than 3 orders. Include their first names, last names, first order dates, and number of orders.
Find customers whose average order size (amount) is greater than 10,000 dollars and who have ordered in the current year. Provide their first name, last name, and average order size.
Display customers whose email does not contain the '@' symbol and who have placed orders this year. Include their first name, last name, and email address.
Find customers whose total orders exceed the average order amount for the entire database and who have placed at least one order this month. Provide their first name, last name, and total number of orders.