AnalystPath

Most-Mentioned Features in Reviews

SQLHardSenior level~15 min

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.

Reviews
reviewer_idreview_idposted_onbody
20112025-06-01Love the @battery and the @screen
20222025-06-03The @battery lasts forever @charging
20332025-06-04Crisp @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

Related SQL questions