Grant Applicants Who Cleared Review
Problem
Table: `applicants`
| Column Name | Type |
|---|---|
| applicant_id | int |
| panel_id | int |
| tenure_years | int |
`applicant_id` is the primary key. `panel_id` is the review panel assigned to the applicant. `tenure_years` is how many years the applicant has worked in the field.
Table: `reviews`
| Column Name | Type |
|---|---|
| panel_id | int |
| points | int |
There is no unique single column. A panel scores several criteria, so a `panel_id` may appear in multiple rows, each row giving the points for one criterion. Return the `applicant_id` of every applicant who has at least `3` years of tenure and whose combined review points across their panel sum to more than `20`. Return the result in any order.
Tables
Example rows — the live problem includes the full dataset.
| applicant_id | panel_id | tenure_years |
|---|---|---|
| 1 | 100 | 5 |
| 2 | 200 | 2 |
| 3 | 300 | 4 |
| panel_id | points |
|---|---|
| 100 | 12 |
| 100 | 15 |
| 200 | 30 |
Expected output
Your answer should return 1 row with the columns applicant_id.
Starter code (SQL)
SELECT *
FROM applicants;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock