Given a schema containing user activity logs, write a query to calculate the daily active users (DAU) who have upvoted posts in more than three distinct subreddits.
Use the activity_logs and users tables. Count each qualifying user once per calendar day.
activity_date, dauactivity_date ascending| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Reddit user identifier |
| username | VARCHAR(40) | Reddit username |
| Column | Type | Description |
|---|---|---|
| activity_idPK | INT | Unique activity event identifier |
| user_id | INT | User who generated the activity |
| event_type | VARCHAR(20) | Type of activity event |
| subreddit_name | VARCHAR(80) | Subreddit associated with the event |
| occurred_at | TIMESTAMP | Timestamp when the activity occurred |