SQL Taskbook Level 2.3

Given a table:

employees
id first_name last_name salary department manager_id start_work_date
1 Aaron Gold 4300.00 PHP 1 2012-02-10
2 Marina Page 4000.00 React NULL 2010-12-10
3 Max Tyler 1500.00 PHP 1 2020-05-30
4 Oliver Barrera 1500.00 Node.js NULL 2020-08-31
5 Andrew Green 900.00 PHP 1 2023-08-31

Solve the following tasks for it:

Задание 1

List the unique departments in which employees work.

Задание 2

Find employees who are paid above the average salary in their department.

Задание 3

Display the first and last names of employees who have worked for more than 5 years.

Задание 4

Find employees who do not have a manager set (NULL in the manager_id field).

Задание 5

Display a list of employees sorted by hire date in descending order.