Player Labels
SQL practice problem 9 of 67 · Text & Dates · Easy · 10 coins for your first accepted solve
Return each player's label: their name followed by their country in brackets, e.g. Ada (VN).
When the country is unknown, show a question mark: Omar (?). Row order does not matter.
Schema
CREATE TABLE players (
id INT PRIMARY KEY,
name TEXT NOT NULL,
country TEXT, -- NULL = unknown
level INT NOT NULL,
joined_on DATE NOT NULL,
mentor_id INT -- another player's id, or NULL
);
Write your query in the browser, run it on the sample data, then submit it against hidden test data.
Previous: Account Age · Next: Item Codes · All problems