Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Lowest and Highest Salary in Department

Medium Window Frames

For each employee return the name, salary and the lowest and highest salary of their department (columns lowest and highest). Order by name.

Table schema

Employees(id INT PRIMARY KEY, name VARCHAR(50), department_id INT, salary INT)

Sample data

id | name | department_id | salary
1 | A | 1 | 100
2 | B | 1 | 200
3 | C | 1 | 300

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.