AnalystPath

Attendees By Track

SQLHardSenior level~15 min

Problem

Table: `attendee`

| Column Name | Type |
|---|---|
| attendee_name | varchar |
| track | varchar |

Each row records a conference attendee and the track they registered for. The `track` is always one of three values: `Design`, `Backend`, `Mobile`.

Pivot the data into three columns named `Design`, `Backend`, and `Mobile`. Within each column the attendee names must be listed in alphabetical order from top to bottom. Because tracks can have different numbers of attendees, shorter columns are padded with `NULL`.

Tables

Example rows — the live problem includes the full dataset.

attendee
attendee_nametrack
NadiaDesign
FelixMobile
WeiBackend

Expected output

Your answer should return 2 rows with the columns Design, Backend, Mobile.

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