2nd Highest Salary
Start Timer
0:00:00
Write a SQL query to select the 2nd highest salary in the engineering department.
Note: If more than one person shares the highest salary, the query should select the next highest salary.
Example:
Input:
employees
table
Column | Type |
---|---|
id |
INTEGER |
first_name |
VARCHAR |
last_name |
VARCHAR |
salary |
INTEGER |
department_id |
INTEGER |
departments
table
Column | Type |
---|---|
id |
INTEGER |
name |
VARCHAR |
Output:
Column | Type |
---|---|
salary |
INTEGER |
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments