Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Second Highest Trader Salary

EasySQL · PostgreSQL00:00
I
Practice interviewer
Your interviewer
In session
I
Interviewer

Welcome to the SQL screen.

The question is on your right: Second Highest Trader Salary. Read through the requirements and the one table first.

Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?

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

Problem

You are given a table of employee salaries from a trading analytics environment. Write a SQL query to return the second highest distinct salary from the table. If the highest salary appears multiple times, it should still count only once. If there is no second distinct salary, the query should return no rows.

Schema

employee_salaries
ColumnTypeDescription
employee_idPKINTUnique employee identifier
employee_nameVARCHAR(100)Employee full name
salaryINTEmployee salary amount
Tablesemployee_salaries
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results