Format the Conference Badge Label
Problem
A conference prints a badge for each attendee. The badge label shows the attendee's full name followed by the first letter of their `department` in parentheses, for example 'Harper(M)' for someone in Marketing.
Write a query that produces the badge label for every attendee, ordered by `attendee_id` from highest to lowest.
Return two columns: `attendee_id` and `label`.
Tables
Example rows — the live problem includes the full dataset.
Attendee
| attendee_id | full_name | department |
|---|---|---|
| 1 | Harper | Sales |
| 3 | Quinn | Analytics |
| 2 | Reyes | Product |
Expected output
Your answer should return 6 rows with the columns attendee_id, label.
Starter code (SQL)
SELECT *
FROM Attendee;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