Top Issue Tags in a Support Queue
Problem
The table `SupportNotes` logs help-desk replies. Each `note_body` contains exactly one square-bracketed tag, for example `[BILLING]` or `[LOGIN]`, marking the topic of the reply. Find the three most-used tags among notes written in March 2025 (from 2025-03-01 to 2025-03-31 inclusive). Return two columns, `issue_tag` (the tag text including its brackets, e.g. `[BILLING]`) and `tag_total` (how many March notes carried it), ordered by `tag_total` descending and then by `issue_tag` descending, keeping only the top three.
Tables
Example rows — the live problem includes the full dataset.
| agent_id | note_id | note_date | note_body |
|---|---|---|---|
| 51 | 9001 | 2025-03-02 | Refund processed [BILLING] |
| 52 | 9002 | 2025-03-04 | Card declined again [BILLING] |
| 53 | 9003 | 2025-03-05 | Reset the password [LOGIN] |
Expected output
Your answer should return 3 rows with the columns issue_tag, tag_total.
Starter code (SQL)
SELECT *
FROM SupportNotes;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