Your question is Three-Day Rolling Average SQL. 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 TMC analytics platform needs a daily view of user login activity. Write a PostgreSQL query that calculates daily valid logins and a three-day rolling average for 2025-05-01 through 2025-05-07.
login_date, daily_logins, and three_day_rolling_avg.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Registered user identifier |
| display_name | VARCHAR(100) | User's display name |
| Column | Type | Description |
|---|---|---|
| login_idPK | INT | Login event identifier |
| user_id | INT | Registered user associated with the login event |
| login_at | TIMESTAMP | Timestamp when the login occurred |