Account Age

SQL practice problem 8 of 67 · Text & Dates · Easy · 10 coins for your first accepted solve

For every player, return name and days — how many days after joining it was on 2026-01-01 (0 if they joined that day). 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: Sign-up Months · Next: Player Labels · All problems