QUICK START:HTMLCSSJavaScriptTypeScriptPythonSQLReactNext.jsNode.jsDSASystem DesignDevOpsCybersecurityAI / ML
SQLMedium

Find Second Highest Salary (SQL)

Write an SQL query to report the second highest salary from the Employee table. If there is no second highest salary, the query should report NULL.

Requirements:

  • Return the result table with a column named SecondHighestSalary.
  • Handle duplicate salaries appropriately.
Sample Input:
Employee: id, salary
Sample Output:
SecondHighestSalary: 200
sql• Solution Editor
EXECUTION CONSOLE
Click “Run & Test Code” to execute your solution against test cases.