You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(emp_id, event_day, in_time) is the primary key of this table.
13
+
The table shows the employees' entries and exits in an office.
14
+
event_day is the day at which this event happened, in_time is the minute at which the employee entered the office, and out_time is the minute at which they left the office.
15
+
in_time and out_time are between 1 and 1440.
16
+
It is guaranteed that no two events on the same day intersect in time, and in_time < out_time.
17
+
18
+
19
+
Required Query:
20
+
21
+
1) Calculate the total time in minutes spent by each employee on each day at the office. Note that within one day, an employee can enter and leave more than once. The time spent in the office for a single entry is out_time - in_time.
22
+
23
+
24
+
SQL Schema:
25
+
26
+
Create table If Not Exists Employees(emp_id int, event_day date, in_time int, out_time int)
0 commit comments