Nations of the Arena

SQL practice problem 15 of 67 · Aggregation · Easy · 10 coins for your first accepted solve

Count how many players come from each country.

Return country and players (the count). Players with no country form their own NULL group. 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: Time Served · Next: Shop Summary · All problems