1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-07 08:21:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>表: <code>Employees</code></p>\n\n<pre>+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| emp_id | int |\n| event_day | date |\n| in_time | int |\n| out_time | int |\n+-------------+------+\n(emp_id, event_day, in_time) 是这个表的主键。\n该表显示了员工在办公室的出入情况。\nevent_day 是此事件发生的日期in_time 是员工进入办公室的时间,而 out_time 是他们离开办公室的时间。\nin_time 和 out_time 的取值在1到1440之间。\n题目保证同一天没有两个事件在时间上是相交的并且保证 in_time 小于 out_time。\n</pre>\n\n<p> </p>\n\n<p>编写一个SQL查询以计算每位员工每天在办公室花费的总时间以分钟为单位。 请注意,在一天之内,同一员工是可以多次进入和离开办公室的。 在办公室里一次进出所花费的时间为out_time 减去 in_time。</p>\n\n<p>返回结果表单的顺序无要求。<br>\n查询结果的格式如下</p>\n\n<pre>Employees table:\n+--------+------------+---------+----------+\n| emp_id | event_day | in_time | out_time |\n+--------+------------+---------+----------+\n| 1 | 2020-11-28 | 4 | 32 |\n| 1 | 2020-11-28 | 55 | 200 |\n| 1 | 2020-12-03 | 1 | 42 |\n| 2 | 2020-11-28 | 3 | 33 |\n| 2 | 2020-12-09 | 47 | 74 |\n+--------+------------+---------+----------+\nResult table:\n+------------+--------+------------+\n| day | emp_id | total_time |\n+------------+--------+------------+\n| 2020-11-28 | 1 | 173 |\n| 2020-11-28 | 2 | 30 |\n| 2020-12-03 | 1 | 41 |\n| 2020-12-09 | 2 | 27 |\n+------------+--------+------------+\n雇员 1 有三次进出: 有两次发生在 2020-11-28 花费的时间为 (32 - 4) + (200 - 55) = 173, 有一次发生在 2020-12-03 花费的时间为 (42 - 1) = 41。\n雇员 2 有两次进出: 有一次发生在 2020-11-28 花费的时间为 (33 - 3) = 30, 有一次发生在 2020-12-09 花费的时间为 (74 - 47) = 27。\n</pre>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 4,
"likes": 11,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -47,7 +47,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"3.1K\", \"totalSubmission\": \"3.8K\", \"totalAcceptedRaw\": 3150, \"totalSubmissionRaw\": 3768, \"acRate\": \"83.6%\"}",
"stats": "{\"totalAccepted\": \"5.3K\", \"totalSubmission\": \"6.2K\", \"totalAcceptedRaw\": 5292, \"totalSubmissionRaw\": 6242, \"acRate\": \"84.8%\"}",
"hints": [],
"solution": null,
"status": null,