AnalystPath

Format the Conference Badge Label

SQLEasyJunior level~15 min

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_idfull_namedepartment
1HarperSales
3QuinnAnalytics
2ReyesProduct

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

Related SQL questions