SQLSQL
#30

User Daily Active Engagement Counts in SQL

Easy
Interview Question #30

From a `user_events` table, calculate how many distinct calendar days each `user_id` interacted with the application during the month of February 2026. Only include users with at least 3 active days.

Input Table: user_events
4 rows preview
event_iduser_idcreated_at
11012026-02-01 10:00:00
21012026-02-01 15:00:00
31012026-02-03 12:00:00
41012026-02-05 09:00:00
Expected Output Structure1 rows
user_idactive_days
1013
Interview Context

Asked frequently in data analyst and business analyst technical rounds. Focus on clean filtering, optimal indexing usage, and unambiguous column selection.

SQLPostgreSQL 15
Ready to execute

Click "Run Query" or press Ctrl + Enter to test your query.

Output will be verified against the test dataset.

Chat with us