Interview Query

Cumulative Reset

24
Have you seen this question before?

Given a users table, write a query to get the cumulative number of new users added by the day, with the total reset every month. 

Example:

Input:

users table

Columns Type
id INTEGER
name VARCHAR
created_at DATETIME

Output:

DATE INTEGER
2020-01-01 5
2020-01-02 12
2020-02-01 8
2020-02-02 17
2020-02-03 23
Next question: Multimodal Sample
.....
MySQL 8.0.17
Loading editor
Use Shift + Enter to run query