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

Gender Pay Gap by Department

For each department return the difference between the average male salary and the average female salary (male minus female), rounded to two decimals. Order by department_id.

Table schema

Employees(id INT PRIMARY KEY, department_id INT, gender CHAR(1), salary INT)

Sample data

id | department_id | gender | salary
1 | 1 | M | 100
2 | 1 | M | 120
3 | 1 | F | 90
4 | 1 | F | 100
5 | 2 | M | 50
6 | 2 | F | 50

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.