diff --git a/solution/3100-3199/3156.Employee Task Duration and Concurrent Tasks/README.md b/solution/3100-3199/3156.Employee Task Duration and Concurrent Tasks/README.md
new file mode 100644
index 0000000000000..85075e66e2fc2
--- /dev/null
+++ b/solution/3100-3199/3156.Employee Task Duration and Concurrent Tasks/README.md
@@ -0,0 +1,158 @@
+---
+comments: true
+difficulty: 困难
+edit_url: https://github.com/doocs/leetcode/edit/main/solution/3100-3199/3156.Employee%20Task%20Duration%20and%20Concurrent%20Tasks/README.md
+---
+
+
+
+# [3156. 员工任务持续时间和并发任务 🔒](https://leetcode.cn/problems/employee-task-duration-and-concurrent-tasks)
+
+[English Version](/solution/3100-3199/3156.Employee%20Task%20Duration%20and%20Concurrent%20Tasks/README_EN.md)
+
+## 题目描述
+
+
+
+
表:Tasks
+
+
++---------------+----------+
+| Column Name | Type |
++---------------+----------+
+| task_id | int |
+| employee_id | int |
+| start_time | datetime |
+| end_time | datetime |
++---------------+----------+
+(task_id, employee_id) 是这张表的主键。
+这张表的每一行包含任务标识,员工标识和每个任务的开始和结束时间。
+
+
+编写一个解决方案来查找 每个 员工的任务 总持续时间 以及员工在任何时间点处理的 最大并发任务数。总时长应该 舍入 到最近的 整小时。
+
+返回结果表以 employee_id
升序 排序。
+
+结果格式如下所示。
+
+
+
+示例:
+
+
+
输入:
+
+
Tasks 表:
+
+
++---------+-------------+---------------------+---------------------+
+| task_id | employee_id | start_time | end_time |
++---------+-------------+---------------------+---------------------+
+| 1 | 1001 | 2023-05-01 08:00:00 | 2023-05-01 09:00:00 |
+| 2 | 1001 | 2023-05-01 08:30:00 | 2023-05-01 10:30:00 |
+| 3 | 1001 | 2023-05-01 11:00:00 | 2023-05-01 12:00:00 |
+| 7 | 1001 | 2023-05-01 13:00:00 | 2023-05-01 15:30:00 |
+| 4 | 1002 | 2023-05-01 09:00:00 | 2023-05-01 10:00:00 |
+| 5 | 1002 | 2023-05-01 09:30:00 | 2023-05-01 11:30:00 |
+| 6 | 1003 | 2023-05-01 14:00:00 | 2023-05-01 16:00:00 |
++---------+-------------+---------------------+---------------------+
+
+
+
输出:
+
+
++-------------+------------------+----------------------+
+| employee_id | total_task_hours | max_concurrent_tasks |
++-------------+------------------+----------------------+
+| 1001 | 6 | 2 |
+| 1002 | 2 | 2 |
+| 1003 | 2 | 1 |
++-------------+------------------+----------------------+
+
+
+
解释:
+
+
+ - 对于员工 ID 1001:
+
+ - 任务 1 和任务 2 从 08:30 到 09:00 重叠(30 分钟)。
+ - 任务 7 持续时间为 150 分钟(2 小时 30 分钟)。
+ - 总工作小时:60(任务 1)+ 120(任务 2)+ 60(任务 3)+ 150(任务 7)- 30(重叠)= 360 分钟 = 6 小时。
+ - 最大并发任务:2 (重叠期间)。
+
+
+ - 对于员工 ID 1002:
+
+ - 任务 4 和任务 5 从 09:30 到 10:00 重叠(30 分钟)。
+ - 总工作时间:60 (任务 4)+ 120(任务 5)- 30(重叠)= 150 分钟 = 2 小时 30 分钟。
+ - 总工作小时:(舍入后):2 小时。
+ - 最大并发任务:2 (重叠期间)。
+
+
+ - 对于员工 ID 1003:
+
+ - 没有重叠的工作。
+ - 总工作时间:120 分钟 = 2 小时。
+ - 最大并发任务:1。
+
+
+
+
+
注意:输出表以 employee_id 升序排序。
+
+
+
+
+## 解法
+
+
+
+### 方法一
+
+
+
+#### MySQL
+
+```sql
+# Write your MySQL query statement below
+WITH
+ T AS (
+ SELECT DISTINCT employee_id, start_time AS st
+ FROM Tasks
+ UNION DISTINCT
+ SELECT DISTINCT employee_id, end_time AS st
+ FROM Tasks
+ ),
+ P AS (
+ SELECT
+ *,
+ LEAD(st) OVER (
+ PARTITION BY employee_id
+ ORDER BY st
+ ) AS ed
+ FROM T
+ ),
+ S AS (
+ SELECT
+ P.*,
+ COUNT(1) AS concurrent_count
+ FROM
+ P
+ INNER JOIN Tasks USING (employee_id)
+ WHERE P.st >= Tasks.start_time AND P.ed <= Tasks.end_time
+ GROUP BY 1, 2, 3
+ )
+SELECT
+ employee_id,
+ FLOOR(SUM(TIME_TO_SEC(TIMEDIFF(ed, st)) / 3600)) AS total_task_hours,
+ MAX(concurrent_count) AS max_concurrent_tasks
+FROM S
+GROUP BY 1
+ORDER BY 1;
+```
+
+
+
+
+
+
diff --git a/solution/3100-3199/3156.Employee Task Duration and Concurrent Tasks/README_EN.md b/solution/3100-3199/3156.Employee Task Duration and Concurrent Tasks/README_EN.md
new file mode 100644
index 0000000000000..90360d766c490
--- /dev/null
+++ b/solution/3100-3199/3156.Employee Task Duration and Concurrent Tasks/README_EN.md
@@ -0,0 +1,157 @@
+---
+comments: true
+difficulty: Hard
+edit_url: https://github.com/doocs/leetcode/edit/main/solution/3100-3199/3156.Employee%20Task%20Duration%20and%20Concurrent%20Tasks/README_EN.md
+---
+
+
+
+# [3156. Employee Task Duration and Concurrent Tasks 🔒](https://leetcode.com/problems/employee-task-duration-and-concurrent-tasks)
+
+[中文文档](/solution/3100-3199/3156.Employee%20Task%20Duration%20and%20Concurrent%20Tasks/README.md)
+
+## Description
+
+
+
+Table: Tasks
+
+
++---------------+----------+
+| Column Name | Type |
++---------------+----------+
+| task_id | int |
+| employee_id | int |
+| start_time | datetime |
+| end_time | datetime |
++---------------+----------+
+(task_id, employee_id) is the primary key for this table.
+Each row in this table contains the task identifier, the employee identifier, and the start and end times of each task.
+
+
+Write a solution to find the total duration of tasks for each employee and the maximum number of concurrent tasks an employee handled at any point in time. The total duration should be rounded down to the nearest number of full hours.
+
+Return the result table ordered by employee_id
ascending order.
+
+The result format is in the following example.
+
+
+Example:
+
+
+
Input:
+
+
Tasks table:
+
+
++---------+-------------+---------------------+---------------------+
+| task_id | employee_id | start_time | end_time |
++---------+-------------+---------------------+---------------------+
+| 1 | 1001 | 2023-05-01 08:00:00 | 2023-05-01 09:00:00 |
+| 2 | 1001 | 2023-05-01 08:30:00 | 2023-05-01 10:30:00 |
+| 3 | 1001 | 2023-05-01 11:00:00 | 2023-05-01 12:00:00 |
+| 7 | 1001 | 2023-05-01 13:00:00 | 2023-05-01 15:30:00 |
+| 4 | 1002 | 2023-05-01 09:00:00 | 2023-05-01 10:00:00 |
+| 5 | 1002 | 2023-05-01 09:30:00 | 2023-05-01 11:30:00 |
+| 6 | 1003 | 2023-05-01 14:00:00 | 2023-05-01 16:00:00 |
++---------+-------------+---------------------+---------------------+
+
+
+
Output:
+
+
++-------------+------------------+----------------------+
+| employee_id | total_task_hours | max_concurrent_tasks |
++-------------+------------------+----------------------+
+| 1001 | 6 | 2 |
+| 1002 | 2 | 2 |
+| 1003 | 2 | 1 |
++-------------+------------------+----------------------+
+
+
+
Explanation:
+
+
+ - For employee ID 1001:
+
+ - Task 1 and Task 2 overlap from 08:30 to 09:00 (30 minutes).
+ - Task 7 has a duration of 150 minutes (2 hours and 30 minutes).
+ - Total task time: 60 (Task 1) + 120 (Task 2) + 60 (Task 3) + 150 (Task 7) - 30 (overlap) = 360 minutes = 6 hours.
+ - Maximum concurrent tasks: 2 (during the overlap period).
+
+
+ - For employee ID 1002:
+
+ - Task 4 and Task 5 overlap from 09:30 to 10:00 (30 minutes).
+ - Total task time: 60 (Task 4) + 120 (Task 5) - 30 (overlap) = 150 minutes = 2 hours and 30 minutes.
+ - Total task hours (rounded down): 2 hours.
+ - Maximum concurrent tasks: 2 (during the overlap period).
+
+
+ - For employee ID 1003:
+
+ - No overlapping tasks.
+ - Total task time: 120 minutes = 2 hours.
+ - Maximum concurrent tasks: 1.
+
+
+
+
+
Note: Output table is ordered by employee_id in ascending order.
+
+
+
+
+## Solutions
+
+
+
+### Solution 1
+
+
+
+#### MySQL
+
+```sql
+# Write your MySQL query statement below
+WITH
+ T AS (
+ SELECT DISTINCT employee_id, start_time AS st
+ FROM Tasks
+ UNION DISTINCT
+ SELECT DISTINCT employee_id, end_time AS st
+ FROM Tasks
+ ),
+ P AS (
+ SELECT
+ *,
+ LEAD(st) OVER (
+ PARTITION BY employee_id
+ ORDER BY st
+ ) AS ed
+ FROM T
+ ),
+ S AS (
+ SELECT
+ P.*,
+ COUNT(1) AS concurrent_count
+ FROM
+ P
+ INNER JOIN Tasks USING (employee_id)
+ WHERE P.st >= Tasks.start_time AND P.ed <= Tasks.end_time
+ GROUP BY 1, 2, 3
+ )
+SELECT
+ employee_id,
+ FLOOR(SUM(TIME_TO_SEC(TIMEDIFF(ed, st)) / 3600)) AS total_task_hours,
+ MAX(concurrent_count) AS max_concurrent_tasks
+FROM S
+GROUP BY 1
+ORDER BY 1;
+```
+
+
+
+
+
+
diff --git a/solution/3100-3199/3156.Employee Task Duration and Concurrent Tasks/Solution.sql b/solution/3100-3199/3156.Employee Task Duration and Concurrent Tasks/Solution.sql
new file mode 100644
index 0000000000000..3c9461aba42d2
--- /dev/null
+++ b/solution/3100-3199/3156.Employee Task Duration and Concurrent Tasks/Solution.sql
@@ -0,0 +1,35 @@
+# Write your MySQL query statement below
+WITH
+ T AS (
+ SELECT DISTINCT employee_id, start_time AS st
+ FROM Tasks
+ UNION DISTINCT
+ SELECT DISTINCT employee_id, end_time AS st
+ FROM Tasks
+ ),
+ P AS (
+ SELECT
+ *,
+ LEAD(st) OVER (
+ PARTITION BY employee_id
+ ORDER BY st
+ ) AS ed
+ FROM T
+ ),
+ S AS (
+ SELECT
+ P.*,
+ COUNT(1) AS concurrent_count
+ FROM
+ P
+ INNER JOIN Tasks USING (employee_id)
+ WHERE P.st >= Tasks.start_time AND P.ed <= Tasks.end_time
+ GROUP BY 1, 2, 3
+ )
+SELECT
+ employee_id,
+ FLOOR(SUM(TIME_TO_SEC(TIMEDIFF(ed, st)) / 3600)) AS total_task_hours,
+ MAX(concurrent_count) AS max_concurrent_tasks
+FROM S
+GROUP BY 1
+ORDER BY 1;
diff --git a/solution/DATABASE_README.md b/solution/DATABASE_README.md
index e151fb4fff2c0..febf28a9e8112 100644
--- a/solution/DATABASE_README.md
+++ b/solution/DATABASE_README.md
@@ -279,6 +279,7 @@
| 3126 | [服务器利用时间](/solution/3100-3199/3126.Server%20Utilization%20Time/README.md) | `数据库` | 中等 | 🔒 |
| 3140 | [连续空余座位 II](/solution/3100-3199/3140.Consecutive%20Available%20Seats%20II/README.md) | `数据库` | 中等 | 🔒 |
| 3150 | [无效的推文 II](/solution/3100-3199/3150.Invalid%20Tweets%20II/README.md) | `数据库` | 简单 | 🔒 |
+| 3156 | [员工任务持续时间和并发任务](/solution/3100-3199/3156.Employee%20Task%20Duration%20and%20Concurrent%20Tasks/README.md) | | 困难 | 🔒 |
## 版权
diff --git a/solution/DATABASE_README_EN.md b/solution/DATABASE_README_EN.md
index 428dfd4774b82..a63f183d24af9 100644
--- a/solution/DATABASE_README_EN.md
+++ b/solution/DATABASE_README_EN.md
@@ -277,6 +277,7 @@ Press Control + F(or Command + F on
| 3126 | [Server Utilization Time](/solution/3100-3199/3126.Server%20Utilization%20Time/README_EN.md) | `Database` | Medium | 🔒 |
| 3140 | [Consecutive Available Seats II](/solution/3100-3199/3140.Consecutive%20Available%20Seats%20II/README_EN.md) | `Database` | Medium | 🔒 |
| 3150 | [Invalid Tweets II](/solution/3100-3199/3150.Invalid%20Tweets%20II/README_EN.md) | `Database` | Easy | 🔒 |
+| 3156 | [Employee Task Duration and Concurrent Tasks](/solution/3100-3199/3156.Employee%20Task%20Duration%20and%20Concurrent%20Tasks/README_EN.md) | | Hard | 🔒 |
## Copyright
diff --git a/solution/README.md b/solution/README.md
index 86297bb930075..f7ba10d162899 100644
--- a/solution/README.md
+++ b/solution/README.md
@@ -3166,6 +3166,7 @@
| 3153 | [所有数对中数位不同之和](/solution/3100-3199/3153.Sum%20of%20Digit%20Differences%20of%20All%20Pairs/README.md) | | 中等 | 第 398 场周赛 |
| 3154 | [到达第 K 级台阶的方案数](/solution/3100-3199/3154.Find%20Number%20of%20Ways%20to%20Reach%20the%20K-th%20Stair/README.md) | | 困难 | 第 398 场周赛 |
| 3155 | [Maximum Number of Upgradable Servers](/solution/3100-3199/3155.Maximum%20Number%20of%20Upgradable%20Servers/README.md) | | 中等 | 🔒 |
+| 3156 | [员工任务持续时间和并发任务](/solution/3100-3199/3156.Employee%20Task%20Duration%20and%20Concurrent%20Tasks/README.md) | | 困难 | 🔒 |
## 版权
diff --git a/solution/README_EN.md b/solution/README_EN.md
index b9f7cf205c6e6..69f5b93f8ca70 100644
--- a/solution/README_EN.md
+++ b/solution/README_EN.md
@@ -3164,6 +3164,7 @@ Press Control + F(or Command + F on
| 3153 | [Sum of Digit Differences of All Pairs](/solution/3100-3199/3153.Sum%20of%20Digit%20Differences%20of%20All%20Pairs/README_EN.md) | | Medium | Weekly Contest 398 |
| 3154 | [Find Number of Ways to Reach the K-th Stair](/solution/3100-3199/3154.Find%20Number%20of%20Ways%20to%20Reach%20the%20K-th%20Stair/README_EN.md) | | Hard | Weekly Contest 398 |
| 3155 | [Maximum Number of Upgradable Servers](/solution/3100-3199/3155.Maximum%20Number%20of%20Upgradable%20Servers/README_EN.md) | | Medium | 🔒 |
+| 3156 | [Employee Task Duration and Concurrent Tasks](/solution/3100-3199/3156.Employee%20Task%20Duration%20and%20Concurrent%20Tasks/README_EN.md) | | Hard | 🔒 |
## Copyright