AnalystPath

Top Issue Tags in a Support Queue

SQLMediumMid level~15 min

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.

SupportNotes
agent_idnote_idnote_datenote_body
5190012025-03-02Refund processed [BILLING]
5290022025-03-04Card declined again [BILLING]
5390032025-03-05Reset 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

Related SQL questions