Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Find Third Highest Salary in SQL
00:00
5 left

Find Third Highest Salary in SQL

EasySQL · PostgreSQL

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
Interviewer

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

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.
CodePostgreSQL
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.