Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Find Duplicate Salaries in SQL
00:00
5 left

Find Duplicate Salaries in SQL

EasySQL · PostgreSQL

Problem

Write a SQL query to identify duplicate salaries in a table.

Use the employee_salaries table. Return only salary values that appear more than once, excluding NULL salaries.

Output

  1. One row per duplicated salary
  2. Columns: salary and employee_count
  3. Sort by salary in ascending order

Schema

employee_salaries
ColumnTypeDescription
employee_idPKINTUnique employee identifier
salaryNUMERIC(12,2)Employee salary amount
Tablesemployee_salaries
Interviewer

Your question is Find Duplicate Salaries 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.