Sitemap
CodeToDeploy

Tech Insights | Careers | Jobs

176. Second Highest Salary Leetcode Sql Problem

A Complete Guide to Finding the Second Highest Distinct Salary Using SQL

3 min readNov 19, 2025

--

Press enter or click to view image in full size

Looking For Remote Tech Roles?
Here’s the shortcut: No recruiters. No waiting.
Just verified $50–$120/hr jobs in:

  • Frontend / Backend / Full Stack
  • Mobile (iOS/Android)
  • AI / ML
  • DevOps & Cloud

If you want to work from anywhere, start here:
👉 Apply Here

SCHEMA

Table: Employee

+-------------+------+
| Column Name | Type |
+-------------+------+
| id | int |
| salary | int |
+-------------+------+
id is the primary key (column with unique values) for this table.
Each row of this table contains information about the salary of an employee.

DESCRIPTION

Write a solution to find the second highest distinct salary from the Employee table. If there is no second highest salary, return null (return None in Pandas).

The result format is in the following example.

EXAMPLE

--

--