Growth Curve

SQL practice problem 53 of 67 · Window Functions · Medium · 25 coins for your first accepted solve

For every month in which someone joined, return month (text YYYY-MM), joined (players who joined that month) and total — how many players had joined by the end of that month.

Sort by month.

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 Between Logins · Next: Level Ranks · All problems