get max salary from each department sql

--Find out the name of top earner in each departments
--Output has Name, Department name and max salary of the department

SELECT E.FIRST_NAME , D.DEPARTMENT_NAME, E.SALARY
FROM EMPLOYEES E
JOIN DEPARTMENTS D ON E.DEPARTMENT_ID = D.DEPARTMENT_ID
WHERE SALARY IN(SELECT MAX(E.SALARY)
FROM EMPLOYEES E
JOIN DEPARTMENTS D ON E.DEPARTMENT_ID = D.DEPARTMENT_ID
GROUP BY DEPARTMENT_NAME);

4.17
6
Nima 95 points

                                    SELECT firstname, MAX(salary)
FROM department d LEFT OUTER JOIN employee e
ON (d.department_id = e.department_id)
GROUP BY department_id; 

4.17 (6 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
count max salary in sql get max salary fro employee in sql how to get the maximum and minimum salary of employees in sql max salary by department sql sql qurey to find max salary max salary from each department sql maximum salary from each department sql sql highest salary in each department department wise max salary in sql second max salary in sql find max salary and youngest employee in every department sql how to get the name that has max salary in sql without sub query get max salary from each department sql server find 3 max salary in sql get 3rd highest salary of each department in sql employee with max salary sql 3rd highest salary in sql using limit top 10 max salary query in sql how to find highest salary in each department in sql select employee with max salary in each department sql find maximum salary in sql query for max salary in sql min and max(salary in sql) max salary in each department sql maximum salary in each department sql sql max salary sql query to find max salary from each department Write a SQL Query to find Max salary and Department name from each department. highest salary in each department sql max salary employee all info in sql max 3 salaries sql how to get 3rd max salary in sql select highest salary from each department in sql max salary with number of people sql Query to get max salary of employee from each department how to find Max salary in sql from Row WRITE SQL Query to find Max Salary from each department(PRINT name and the Max Salary) WRITE SQL Query to find Max Salary from each department(PRINT dname and the Max Salary) how to get maximum salary of an employee in sql sql sql query to get maximum salary in each department from single table sql sql query to get maximum salary in each department 4 highest salary in sql select max salary from each department in sql how to find max and min salary in sql sql max salary of employee annual salary in sql IS MAX SALARY? sql query for max salary how to find maximum salary without using max function in sql query to find maximum salary of employee in sql query to find and print max salary in sql how to print max salary in sql max salary in sql 4 th max salary sql command select 3 max salary in sql 2 max salary in sql 3 max salary in sql get max salary in sql write SQL to find max salary select max salary record sql select max salary in sql query to find max salary select max 3 salary in sql maximum salary in sql SQL Select employee which have the max salary in a given department sql maximum salary from salary table? third highest salary in sql thirdhighest salary sql how to get max 3 salary in sql 5th highest salary in sql max 3 salary in sql how to get second highest salary in each department in sql how to get max salary in each department in sql how to get max from each department in sql how to get maximum salary in sql find max salary from each department in sql find out max salary between dept = 20 and 40 Getting maximum salary from each department. the tables in each deoartment is different max salary from each department in sql top salary from each department in sql highest salary from each department in sql get top salary from each department in sql get max salary from each department in sql get max salary from each department sql
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source