Gender Pay Gap by Department
Hard
HR Analytics
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.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.