Your question is Top Users Per Region Query. 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.
LinkedIn's Business Intelligence team wants to identify the most active members in each geographic region. Write a PostgreSQL query that counts member interactions and ranks members within their region.
users to user_interactions and count interactions per member.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique LinkedIn member identifier |
| display_name | VARCHAR(100) | Member display name |
| region | VARCHAR(50) | Member reporting region |
| Column | Type | Description |
|---|---|---|
| interaction_idPK | INT | Unique interaction identifier |
| user_id | INT | Member who generated the interaction |
| interaction_type | VARCHAR(50) | Interaction category |
| occurred_at | TIMESTAMP | Interaction timestamp |