Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Second Highest Salary at NovaTech
00:00
5 left

Second Highest Salary at NovaTech

EasySQL · PostgreSQL

Problem

NovaTech wants a quick salary check from its employee records. Write a SQL query to return the second highest distinct salary from the employees table.

Requirements

  1. Return exactly one column named second_highest_salary
  2. Treat duplicate salaries as the same salary value
  3. If a second highest salary does not exist, return NULL

Schema

employees
ColumnTypeDescription
employee_idPKINTUnique employee identifier
employee_nameVARCHAR(100)Employee full name
departmentVARCHAR(50)Employee department
salaryINTEmployee salary amount
Tablesemployees
Interviewer

Your question is Second Highest Salary at NovaTech. 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.