Overtime Pay
Medium
Payroll Calculations
Hours above 160 are overtime paid at 20 per hour. Return each employee's overtime pay (0 if none), ordered by name.
Table schema
Employees(id INT PRIMARY KEY, name VARCHAR(10), base INT, hours_worked INT, dept VARCHAR(5))Sample data
id | name | base | hours_worked | dept
1 | Ann | 3000 | 170 | IT
2 | Bob | 2500 | 200 | IT
3 | Cy | 2000 | 160 | HR
4 | Dee | 4000 | 150 | HR
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.