SQL Exercise: Find the highest salary from all the employees

SQL employee Database: Exercise-90 with Solution

[An editor is available at the bottom of the page to write and execute the scripts.]

90. From the following table, write a SQL query to find the highest salary. Return highest salary.

Sample table: employees

Sample Solution:

SELECT max(salary)
FROM employees;

Sample Output:

(1 row)


The said query in SQL selects the maximum value of the salary column from the employees table. The MAX() function is used to retrieve the highest value of the salary column.

Relational Algebra Expression:

Relational Algebra Expression: Find the highest salary from all the employees.

Relational Algebra Tree:

Relational Algebra Tree: Find the highest salary from all the employees.

Practice Online

Sample Database: employee

employee database structure

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous SQL Exercise: Employees in ASC order of salary in department 1001.
Next SQL Exercise: Average salary, total remuneration for each type of job.

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.

Follow us on Facebook and Twitter for latest update.