Leetcode Problem 1107. New Users Daily Count

1107. New Users Daily Count

Leetcode Solutions

Identifying First-Time Logins Within a-Day Window

  1. Select only the rows from the Traffic table where the activity is 'login'.
  2. Group the resulting rows by user_id and use the MIN function to find the earliest activity_date for each user, which represents their first login date.
  3. Filter these first login dates to include only those within the 90-day window ending on '2019-06-30'.
  4. Group the filtered results by activity_date and count the number of users for each date to get the daily count of first-time logins.
  5. Return the results with the activity_date as login_date and the count as user_count.

erDiagram
    Traffic {
        int user_id
        enum activity
        date activity_date
    }

Counting First-Time Logins Using Dense Ranking

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...