You are given a table Problems that contains information about LeetCode problems, including the number of likes and dislikes for each problem.
Table: Problems
| Column Name | Type |
|---|---|
| problem_id | int |
| likes | int |
| dislikes | int |
In SQL, problem_id is the primary key column for this table. Each row of this table indicates the number of likes and dislikes for a LeetCode problem.
Task: Find the IDs of the low-quality problems. A LeetCode problem is low-quality if the like percentage of the problem (number of likes divided by the total number of votes) is strictly less than 60%.
Return the result table ordered by problem_id in ascending order.
Table Schema
| Column Name | Type | Description |
|---|---|---|
problem_id
PK
|
int | Unique identifier for each problem |
likes
|
int | Number of likes for the problem |
dislikes
|
int | Number of dislikes for the problem |
Input & Output
| problem_id | likes | dislikes |
|---|---|---|
| 6 | 1290 | 425 |
| 11 | 2677 | 8659 |
| 7 | 24 | 40 |
| problem_id |
|---|
| 7 |
| 11 |
Problem 6: Like percentage = 1290/(1290+425) = 1290/1715 ≈ 75.2% → Not low-quality (≥ 60%)
Problem 7: Like percentage = 24/(24+40) = 24/64 = 37.5% → Low-quality (< 60%)
Problem 11: Like percentage = 2677/(2677+8659) = 2677/11336 ≈ 23.6% → Low-quality (< 60%)
Results are ordered by problem_id: [7, 11]
| problem_id | likes | dislikes |
|---|---|---|
| 1 | 100 | 50 |
| 2 | 200 | 100 |
| problem_id |
|---|
Problem 1: Like percentage = 100/(100+50) = 100/150 ≈ 66.7% → Not low-quality
Problem 2: Like percentage = 200/(200+100) = 200/300 ≈ 66.7% → Not low-quality
No problems have like percentage < 60%, so result is empty.
| problem_id | likes | dislikes |
|---|---|---|
| 5 | 60 | 40 |
| 8 | 59 | 41 |
| problem_id |
|---|
| 8 |
Problem 5: Like percentage = 60/(60+40) = 60/100 = 60.0% → Not low-quality (exactly 60%)
Problem 8: Like percentage = 59/(59+41) = 59/100 = 59.0% → Low-quality (< 60%)
Only problem 8 is strictly less than 60%.
Constraints
-
1 ≤ problem_id ≤ 100 -
0 ≤ likes ≤ 100 -
0 ≤ dislikes ≤ 100 -
likes + dislikes > 0