Top Daily Depositor

Start Timer

0:00:00

Upvote
3
Downvote
Save question
View comments

Given a deposits table where each row is a single deposit transaction, find the day on which one user made the most deposits, and return that user along with the total number of deposits made by all users on that same day.

Note: If several user-days tie for the most deposits, return the one with the lower user_id; if still tied (the same user on several days), return the earliest deposit_date.

Example:

Input:

deposits table

Column Type
id INTEGER
user_id INTEGER
amount FLOAT
created_at DATETIME

Output:

Column Type
deposit_date DATE
user_id INTEGER
user_deposit_count INTEGER
total_deposits_that_day INTEGER
.
.
.
.
.


Comments

Loading comments