Back to Practice
#0394

Cumulative Users by Signup Day

MediumSQL24 min20 XP

Problem

Return signup_date, new_users, and cumulative_users.

Why This Matters

SQL interviews usually test whether you can turn a business question into the right rows, grouping level, join type, and edge-case behavior.

Schema

users(user_id INTEGER, signup_date TEXT)

Examples

Example 1
Input2 signups on Jan 1, 1 on Jan 2
Outputcumulative 2 then 3

Aggregate first, then apply a running sum over days.

Constraints

  • Return only the requested columns.
  • Use deterministic ORDER BY when multiple rows are returned.
  • Assume SQLite-compatible SQL unless the prompt states otherwise.
CodeSQL
Visible browser tests run here when available.
Testcases1 visible / 3 hidden categories
Core SQL case
Input2 signups on Jan 1, 1 on Jan 2
Expected[["2026-01-01",2,2],["2026-01-02",1,3]]

Aggregate first, then apply a running sum over days.

Hidden Test Categories
Empty or missing matchesDuplicate rows or tiesNULL values where the pattern commonly breaks