How to Identify Employees with the Highest Number of Overtime Hours in SQL
This query identifies employees who have worked the highest number of overtime hours.
SELECT
employee_id,
employee_name,
SUM(overtime_hours) AS total_overtime
FROM
timesheets
GROUP BY
employee_id,
employee_name
ORDER BY
total_overtime DESC
LIMIT
5;
Use-case: An HR manager wants to recognize and reward employees who frequently work overtime.
Ready to build Dashboards
and set Alerts?
This website uses cookies to ensure you get the best experience.