Your question is Top Active Users With Window Functions. 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.
Cengage wants to identify the most engaged users of its digital learning products each month. Write a PostgreSQL query that counts valid activity events and returns the top three users for January and February 2025.
user_id ascending.| Column | Type | Description |
|---|---|---|
| user_idPK | INTEGER | Unique Cengage user identifier |
| display_name | VARCHAR(100) | User's display name |
| VARCHAR(255) | User email address |
| Column | Type | Description |
|---|---|---|
| event_idPK | INTEGER | Unique activity event identifier |
| user_id | INTEGER | Associated user identifier |
| occurred_at | TIMESTAMP | Time when the event occurred |
| event_type | VARCHAR(50) | Type of learning activity |