My SQL solution with Window Function SUM()
\nselect\n    distinct\n    event_day as day,\n    emp_id,\n    sum(out_time - in_time) over (partition by emp_id, event_day)as total_time\nfrom employees\n
```\nselect\n    distinct\n    event_day as day,\n    emp_id,\n    sum(out_time - in_time) over (partition by emp_id, event_day)as total_time\nfrom employees\n```
['Sliding Window', 'MySQL']