Given a table 'employees'

```
 employee_id | salary | department_id 
-------------+--------+---------------

```

Only using SQL find all the variants of employee-transfers from one department to another, so that average salary in both 'departure' and 'arrival' department grew.

PS I was asked the question on a interview, which never gave an answer, and Google is of little help.