Back to problems

Second Highest Salary

SQL · Apple · Easy

We have an employee table that stores each person's ID, name, and salary. Table: employee Column Name Type employee_id integer name string salary integer The employee_id column is the table's primary key. Write a query that retrieves the second highest distinct salary present in the table. If several employees earn that same second highest salary, the value should still be returned only once. When the table does not contain a second highest distinct salary, the result must…

Checking your access…