Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL Query for Max Salary

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

Your question is SQL Query for Max Salary. 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

Business Context

Quantiphi’s workforce reporting team needs a simple compensation metric for internal analysis. The result will be used to identify the highest recorded salary in the employee dataset.

Task

Write a PostgreSQL query that returns the maximum non-NULL salary from the employees table.

Requirements

  1. Use the MAX aggregate function on the salary column.
  2. Return one row with the output column aliased as maximum_salary.

Schema

employees
ColumnTypeDescription
employee_idPKINTEGERUnique employee identifier
employee_nameVARCHAR(100)Employee’s full name
departmentVARCHAR(50)Employee’s department
salaryNUMERIC(10,2)Annual salary, which may be unavailable
Tablesemployees
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results