Last Updated: 2 Aug, 2021

Second Highest Salary

Moderate
Asked in companies
MicrosoftFlipkart limited

Problem statement

Write a SQL query to get the second highest salary from the 
Employee table.

+----+--------+
| Id | Salary |
+----+--------+
| 1  | 100    |
| 2  | 200    |
| 3  | 300    |
+----+--------+
For example, given the above Employee table, the query should return 200 as the second highest salary. If there is no second highest salary, then the query should return null.

+---------------------+
| salary              |
+---------------------+
| 200                 |
+---------------------+
Similar problems

Find the Quiet Students in All Exams

Hard
Posted: 26 Aug, 2021

Find the Quiet Students in All Exams

Hard
Posted: 26 Aug, 2021

Find the Quiet Students in All Exams

Hard
Posted: 26 Aug, 2021

Find the Quiet Students in All Exams

Hard
Posted: 26 Aug, 2021

Find the Quiet Students in All Exams

Hard
Posted: 26 Aug, 2021

Find the Quiet Students in All Exams

Hard
Posted: 26 Aug, 2021

Find the Quiet Students in All Exams

Hard
Posted: 26 Aug, 2021

Find the Quiet Students in All Exams

Hard
Posted: 26 Aug, 2021

Find the Quiet Students in All Exams

Hard
Posted: 26 Aug, 2021

Find the Quiet Students in All Exams

Hard
Posted: 26 Aug, 2021

Find the Quiet Students in All Exams

Hard
Posted: 26 Aug, 2021

Find the Quiet Students in All Exams

Hard
Posted: 26 Aug, 2021

Find the Quiet Students in All Exams

Hard
Posted: 26 Aug, 2021

Find Cumulative Salary of an Employee

Hard
Posted: 26 Aug, 2021

Find Cumulative Salary of an Employee

Hard
Posted: 26 Aug, 2021

Find Cumulative Salary of an Employee

Hard
Posted: 26 Aug, 2021

Find Cumulative Salary of an Employee

Hard
Posted: 26 Aug, 2021

Find Cumulative Salary of an Employee

Hard
Posted: 26 Aug, 2021

Find Cumulative Salary of an Employee

Hard
Posted: 26 Aug, 2021

Find Cumulative Salary of an Employee

Hard
Posted: 26 Aug, 2021

Find Cumulative Salary of an Employee

Hard
Posted: 26 Aug, 2021

Find Cumulative Salary of an Employee

Hard
Posted: 26 Aug, 2021

Find Cumulative Salary of an Employee

Hard
Posted: 26 Aug, 2021

Marvel Cities

Easy
Posted: 2 Sep, 2021

Marvel Cities

Easy
Posted: 2 Sep, 2021

Marvel Cities

Easy
Posted: 2 Sep, 2021

Marvel Cities

Easy
Posted: 2 Sep, 2021

Marvel Cities

Easy
Posted: 2 Sep, 2021

Marvel Cities

Easy
Posted: 2 Sep, 2021

Marvel Cities

Easy
Posted: 2 Sep, 2021

Marvel Cities

Easy
Posted: 2 Sep, 2021

Marvel Cities

Easy
Posted: 2 Sep, 2021

Marvel Cities

Easy
Posted: 2 Sep, 2021

Marvel Cities

Easy
Posted: 2 Sep, 2021

Director's Actor

Easy
Posted: 3 Sep, 2021

Director's Actor

Easy
Posted: 3 Sep, 2021

Director's Actor

Easy
Posted: 3 Sep, 2021

Director's Actor

Easy
Posted: 3 Sep, 2021

Director's Actor

Easy
Posted: 3 Sep, 2021

Director's Actor

Easy
Posted: 3 Sep, 2021

Director's Actor

Easy
Posted: 3 Sep, 2021

Director's Actor

Easy
Posted: 3 Sep, 2021

Director's Actor

Easy
Posted: 3 Sep, 2021

Director's Actor

Easy
Posted: 3 Sep, 2021

Director's Actor

Easy
Posted: 3 Sep, 2021

Director's Actor

Easy
Posted: 3 Sep, 2021

Director's Actor

Easy
Posted: 3 Sep, 2021

Spotify Sessions

Easy
Posted: 3 Sep, 2021

Spotify Sessions

Easy
Posted: 3 Sep, 2021

Spotify Sessions

Easy
Posted: 3 Sep, 2021

Spotify Sessions

Easy
Posted: 3 Sep, 2021

Spotify Sessions

Easy
Posted: 3 Sep, 2021

Spotify Sessions

Easy
Posted: 3 Sep, 2021

Spotify Sessions

Easy
Posted: 3 Sep, 2021

Spotify Sessions

Easy
Posted: 3 Sep, 2021

Spotify Sessions

Easy
Posted: 3 Sep, 2021

Spotify Sessions

Easy
Posted: 3 Sep, 2021

Spotify Sessions

Easy
Posted: 3 Sep, 2021

Spotify Sessions

Easy
Posted: 3 Sep, 2021

Spotify Sessions

Easy
Posted: 3 Sep, 2021