Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Find Third Highest Salary in SQL

EasySQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Find Third Highest Salary in SQL. Start with the requirements and the one table on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Arcesium's compensation analytics team needs to identify the third-highest distinct salary in an employee dataset. Write a PostgreSQL query that returns exactly one salary value.

Requirements

  1. Ignore employees whose salary is NULL.
  2. Return the third distinct salary when salaries are ordered from highest to lowest.

Use only the employees table. Do not return employee details or calculate the result procedurally.

Schema

employees
ColumnTypeDescription
employee_idPKINTUnique employee identifier
employee_nameVARCHAR(100)Employee's name
salaryNUMERIC(12,2)Annual salary in USD
Tablesemployees
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results