Country Roster

SQL practice problem 23 of 67 · Aggregation · Medium · 25 coins for your first accepted solve

For every known country, return country and players — the names of its players in alphabetical order, separated by a comma and a space (e.g. Ada, Mai, Tuan). 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: Potions or Steel · Next: Category Totals · All problems