Back to problems

Second Highest Salary

SQL · Microsoft · Easy

Table: employee The primary key of this table is employee_id. Your task is to determine the second-highest distinct salary value present in the employee table. When several employees have that same second-highest salary, it should be returned as a single value. If a second-highest salary does not exist, the result should be null. The expected output format is illustrated below. Example Input: Output: Explanation: The top salary is 3800. The largest salary that is strictly…

Checking your access…