Hinge's analytics team wants to monitor engagement with the Discover experience. Write a PostgreSQL query that calculates each user's rolling average of daily interactions over the preceding 30 calendar days, including the current interaction date.
Use 2026-03-01 as the report date. Only interactions from 2026-02-01 through 2026-03-01, inclusive, should be considered.
daily_interactions.user_id and interaction_date.user_id, display_name, interaction_date, daily_interactions, rolling_avg_30d.user_id ascending, then interaction_date ascending.rolling_avg_30d to 4 decimal places.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Hinge user identifier |
| display_name | VARCHAR(100) | User display name |
| Column | Type | Description |
|---|---|---|
| interaction_idPK | INT | Unique interaction event identifier |
| user_id | INT | User associated with the interaction |
| interaction_type | VARCHAR(50) | Type of Hinge interaction |
| occurred_at | TIMESTAMP | Timestamp when the interaction occurred |