Table: employees
Table: performance_reviews
Write a solution to find employees who have consistently improved their performance over their last three reviews.
Return the result table ordered by improvement score in descending order, then by name in ascending order.
The result format is in the following example.
Examples
Example 1
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| employee_id | int |
| name | varchar |
+-------------+---------+
employee_id is the unique identifier for this table.
Each row contains information about an employee.
Example 2
+-------------+------+
| Column Name | Type |
+-------------+------+
| review_id | int |
| employee_id | int |
| review_date | date |
| rating | int |
+-------------+------+
review_id is the unique identifier for this table.
Each row represents a performance review for an employee. The rating is on a scale of 1-5 where 5 is excellent and 1 is poor.
Example 3
+-------------+----------------+
| employee_id | name |
+-------------+----------------+
| 1 | Alice Johnson |
| 2 | Bob Smith |
| 3 | Carol Davis |
| 4 | David Wilson |
| 5 | Emma Brown |
+-------------+----------------+
+-------------+----------------+-------------------+
| employee_id | name | improvement_score |
+-------------+----------------+-------------------+
| 2 | Bob Smith | 3 |
| 1 | Alice Johnson | 2 |
| 3 | Carol Davis | 2 |
+-------------+----------------+-------------------+
3580. Find Consistently Improving Employees
Medium
30 Points
Database
Table: employees
Table: performance_reviews
Write a solution to find employees who have consistently improved their performance over their last three reviews.
Return the result table ordered by improvement score in descending order, then by name in ascending order.
The result format is in the following example.
Examples
Example 1
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| employee_id | int |
| name | varchar |
+-------------+---------+
employee_id is the unique identifier for this table.
Each row contains information about an employee.
Example 2
+-------------+------+
| Column Name | Type |
+-------------+------+
| review_id | int |
| employee_id | int |
| review_date | date |
| rating | int |
+-------------+------+
review_id is the unique identifier for this table.
Each row represents a performance review for an employee. The rating is on a scale of 1-5 where 5 is excellent and 1 is poor.
Example 3
+-------------+----------------+
| employee_id | name |
+-------------+----------------+
| 1 | Alice Johnson |
| 2 | Bob Smith |
| 3 | Carol Davis |
| 4 | David Wilson |
| 5 | Emma Brown |
+-------------+----------------+
+-------------+----------------+-------------------+
| employee_id | name | improvement_score |
+-------------+----------------+-------------------+
| 2 | Bob Smith | 3 |
| 1 | Alice Johnson | 2 |
| 3 | Carol Davis | 2 |
+-------------+----------------+-------------------+
Find Consistently Improving Employees - Practice Coding | SlaveCode