Table Name : clocked_hours
Column Name | Type |
---|---|
empd_id | int |
swipe | time |
flag | char |
- (empd_id, swipe) is the primary key for this table.
This table provides empd_id (Employee ID), swipe time (swipe), and swipe type (flag). Flag can have only two values- 'I' and 'O' signifying Entry time and exit time.
Write a SQL query to find the total clocked time for each employees.
Return the result table in any order.
The query result format is in the following example:
Input
Table Name : clocked_hours
empd_id | swipe | flag |
---|---|---|
11114 | 08:30 | I |
11114 | 10:30 | O |
11114 | 11:30 | I |
11114 | 15:30 | O |
11115 | 09:30 | I |
11115 | 17:30 | O |
Output
empd_id | clocked_time |
---|---|
11114 | 6 Hours 0 Minutes 0.00 Seconds |
11115 | 8 Hours 0 Minutes 0.00 Seconds |