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

Percentage of Department Payroll

For each employee return their salary as a percentage of their department's total salary, rounded to two decimals. Order by id.

Table schema

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

Sample data

id | name | department_id | salary
1 | Alice | 1 | 6000
2 | Bob | 1 | 4000
3 | Carol | 2 | 5000

Discussion

No discussions yet.

Rewards ยท v2.1

Join Shalyam Newsletter

Get exclusive insights with every issue: education, research and innovation news.

One email a week. Unsubscribe any time.