SIMPLE LOGIC NO ADVANCE FUNCTION USED
\nSELECT    D.name AS DEPARTMENT , \n          E.name AS EMPLOYEE , \n\t\t  E.salary\n     FROM EMPLOYEE AS E \n\t               JOIN \n\t\t\t\t   DEPARTMENT AS
```\nSELECT    D.name AS DEPARTMENT , \n          E.name AS EMPLOYEE , \n\t\t  E.salary\n     FROM EMPLOYEE AS E \n\t               JOIN \n\t\t\t\t   DEPARTMENT AS D \n\t\t\t\t   ON E.departmentId = D.id\n     WHERE E.salary =   ( SELECT MAX(salary) # this subquery gives max salary  of an department so that we can generate all employees who have max salary in that department.\n                                 FROM EMPLOYEE\n                                 WHERE departmentID = E.departmentID);\n```
[]