Most-Mentioned Features in Reviews
Problem
The table `Reviews` stores product reviews. Each `body` may mention zero, one, or several product features, each written as an `@` token made only of letters, digits, and underscores, for example `@battery` or `@screen_size`. A single review can mention the same feature more than once and every mention counts. Considering only reviews posted in June 2025 (from 2025-06-01 to 2025-06-30 inclusive), return the three most-mentioned features as `feature` (the token including its leading `@`) and `mentions` (total times mentioned), ordered by `mentions` descending then by `feature` descending, limited to the top three.
Tables
Example rows — the live problem includes the full dataset.
| reviewer_id | review_id | posted_on | body |
|---|---|---|---|
| 201 | 1 | 2025-06-01 | Love the @battery and the @screen |
| 202 | 2 | 2025-06-03 | The @battery lasts forever @charging |
| 203 | 3 | 2025-06-04 | Crisp @display and great @camera |
Expected output
Your answer should return 3 rows with the columns feature, mentions.
Starter code (SQL)
SELECT *
FROM Reviews;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