Your question is Top 3 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.
The Nio Robotics Fleet Console team wants to identify its most active users during August 2026. Write a PostgreSQL query using the users and activity_events tables.
user_id, display name, and activity count.user_id ascending as the deterministic tie-breaker when users have the same activity count.| Column | Type | Description |
|---|---|---|
| user_idPK | INTEGER | Unique registered user identifier |
| display_name | VARCHAR(100) | User's Fleet Console display name |
| role | VARCHAR(40) | User role in the robotics operation |
| Column | Type | Description |
|---|---|---|
| event_idPK | INTEGER | Unique activity event identifier |
| user_id | INTEGER | User associated with the activity event |
| event_type | VARCHAR(40) | Type of Fleet Console activity |
| occurred_at | TIMESTAMP | Timestamp when the activity occurred |