Daily Active Users
Programming Interview
Easy
9 views
Problem Description
Table: Logins(user_id, login_time). Return date and number of distinct users per date.
Input Format
SQL tables are described in the question.
Output Format
Write the SQL query.
Official Solution
SELECT CAST(login_time AS DATE) AS day, COUNT(DISTINCT user_id) AS dau
FROM Logins
GROUP BY CAST(login_time AS DATE)
ORDER BY day;
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!