INNER JOIN Solurion of department highest salary problem
Approach\n- The INNER JOIN keyword selects records that have matching values in both tables.\n- The WHERE clause is used to filter records. \n- The MAX() functi
# Approach\n- The `INNER JOIN` keyword selects records that have matching values in both tables.\n- The `WHERE` clause is used to filter records. \n- The `MAX()` function returns the largest value of the selected column.\n- The `GROUP B`Y statement groups rows that have the same values into summary rows.\n# Code\n```\nSELECT dep.name AS Department, emp.name AS Employee, salary AS Salary\nFROM Employee emp\nINNER JOIN Department dep ON emp.departmentId = dep.id\nWHERE (salary, emp.departmentId)  IN (SELECT MAX(empdep.salary), empdep.departmentId\nFROM Employee empdep\nGROUP BY empdep.departmentId\n)\n```
['Database', 'MySQL']