LeetCode solutions

1892. Find Total Time Spent by Each Employee

My accepted SQL solution to LeetCode problem 1892, Find Total Time Spent by Each Employee, running in 477ms.

  • Difficulty: Easy
  • SQL
  • Runtime 477ms
  • Memory 0.0B

Read the problem on LeetCode View on GitHub

SQL

Accepted on LeetCode — runtime 477ms, memory 0.0B, accepted 2025-12-31.

sql
SELECT event_day AS day, emp_id, 
       SUM(out_time - in_time) AS total_time
FROM Employees
GROUP BY event_day, emp_id

Source