Your question is Detect 5-Day Active Streaks. Start with the requirements and the one table 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.
Adobe Express wants to identify creators who used the product on at least one event per day for a continuous 5-day streak. Write a PostgreSQL query that returns every qualifying streak for each creator.
DENSE_RANK() and LAG().| Column | Type | Description |
|---|---|---|
| activity_idPK | INT | Primary key for the activity event |
| creator_id | INT | Adobe Express creator identifier |
| creator_name | VARCHAR(255) | Creator display name |
| activity_ts | TIMESTAMP | Timestamp when the creator generated an activity event |
| surface | VARCHAR(50) | Adobe Express surface where the event occurred |
| event_type | VARCHAR(50) | Type of activity event |