Your question is SQL for Power Users. Start with the requirements and the three 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.
How would you write a SQL query to identify power users at Aircall based on call volume and integration usage?
For this exercise, consider a user a power user if they made at least 5 calls and used at least 2 distinct integrations during January 2025. Use the users, calls, and integration_usage tables.
user_id, user_name, call_volume, and integration_count.call_volume descending, integration_count descending, then user_id ascending.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Aircall user identifier |
| user_name | VARCHAR(100) | User display name |
| VARCHAR(255) | User email address |
| Column | Type | Description |
|---|---|---|
| call_idPK | INT | Unique call identifier |
| user_id | INT | User who handled the call |
| call_started_at | TIMESTAMP | Call start timestamp |
| duration_seconds | INT | Call duration in seconds |
| Column | Type | Description |
|---|---|---|
| usage_idPK | INT | Unique integration usage event identifier |
| user_id | INT | User associated with the integration event |
| integration_name | VARCHAR(100) | Aircall integration used |
| used_at | TIMESTAMP | Integration usage timestamp |