Your question is Top N Users Per Day. 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.
Databricks administrators want a daily view of the users generating the most activity in Databricks SQL. Write a PostgreSQL query that counts valid activity events per user and returns the top three activity ranks for each calendar day.
activity_logs to users so the output includes each user's name.activity_type, grouped by user and activity date.activity_date, user_id, user_name, and activity_count, ordered by date, rank, and user ID.| Column | Type | Description |
|---|---|---|
| user_idPK | INTEGER | Unique Databricks user identifier |
| user_name | VARCHAR(100) | User display name |
| VARCHAR(255) | User email address |
| Column | Type | Description |
|---|---|---|
| activity_idPK | INTEGER | Unique activity event identifier |
| user_id | INTEGER | User associated with the activity event |
| activity_at | TIMESTAMP | Timestamp when the activity occurred |
| activity_type | VARCHAR(50) | Type of activity, nullable when event metadata is incomplete |