Your question is Top 10 Users by Activity. 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.
Netsmart Technologies wants to identify the most active users of myAvatar during January 2025. Write a PostgreSQL query that ranks users by recorded activity.
user_id ascending as a deterministic tie-breaker.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| full_name | VARCHAR(100) | User's display name |
| VARCHAR(255) | User's email address | |
| role_name | VARCHAR(50) | myAvatar access role |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique activity event identifier |
| user_id | INT | Associated user identifier |
| activity_type | VARCHAR(50) | Type of myAvatar activity |
| occurred_at | TIMESTAMP | Timestamp when the activity occurred |