Skip to content

Commit d0961cc

Browse files
committed
Upload 153
1 parent 10d1bfa commit d0961cc

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ The problems and both submitted and site solutions are documented in individual
185185
| 150 | [Reformat Department Table](https://leetcode.com/problems/reformat-department-table/description/) | [Solution](solutions/150_reformat_department_table.md) | LeetCode | Easy | |
186186
| 151 | [Capital Gain/Loss](https://leetcode.com/problems/capital-gainloss/description/) | [Solution](solutions/151_capital_gainloss.md) | LeetCode | Medium | |
187187
| 152 | [Daily Leads and Partners](https://leetcode.com/problems/daily-leads-and-partners/description/) | [Solution](solutions/152_daily_leads_and_partners.md) | LeetCode | Easy | |
188+
| 153 | [Find Total Time Spent by Each Employee](https://leetcode.com/problems/find-total-time-spent-by-each-employee/description/) | [Solution](solutions/153_find_total_time_spent_by_each_employee.md) | LeetCode | Easy | |
188189
<!-- Index End - WARNING: Do not delete or modify this markdown comment. -->
189190

190191
## Author(s)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# SQL Everyday \#153
2+
3+
## Find Total Time Spent by Each Employee
4+
5+
Site: LeetCode\
6+
Difficulty per Site: Easy
7+
8+
## Problem
9+
10+
Write a solution to 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`.
11+
12+
Return the result table in *any order*. [[Full Description](https://leetcode.com/problems/find-total-time-spent-by-each-employee/description/)]
13+
14+
## Submitted Solution
15+
16+
```sql
17+
-- Submitted Solution
18+
SELECT
19+
event_day AS day
20+
,emp_id
21+
,SUM(out_time - in_time) AS total_time
22+
FROM Employees
23+
GROUP BY day, emp_id
24+
ORDER BY day ASC, emp_id ASC
25+
;
26+
```
27+
28+
## Site Solution
29+
30+
```sql
31+
-- LeetCode Solution
32+
-- TBD
33+
```
34+
35+
## Notes
36+
37+
TBD
38+
39+
## NB
40+
41+
TBD
42+
43+
Go to [Index](../?tab=readme-ov-file#index)\
44+
Go to [Overview](../?tab=readme-ov-file)

0 commit comments

Comments
 (0)