Your question is Daily Active Users and Churn. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Wish wants a daily engagement report for users interacting with the Wish marketplace. Using the tables below, write a PostgreSQL query for activity from January 1 through January 5, 2025.
daily_active_users as the distinct number of registered users with at least one activity event on that date.daily_churned_users as users active on the previous day who have no activity on the current day. Do not count users who were not active on the previous day.activity_date.Deduplicate multiple activity events from the same user on the same date before calculating either metric.
| Column | Type | Description |
|---|---|---|
| user_idPK | INTEGER | Unique Wish user identifier |
| display_name | VARCHAR(100) | User display name |
| Column | Type | Description |
|---|---|---|
| activity_idPK | INTEGER | Unique activity event identifier |
| user_id | INTEGER | User associated with the activity event |
| activity_date | DATE | Calendar date of the activity event |
| event_type | VARCHAR(40) | Type of marketplace activity |