Your question is Query Player Churn. 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.
Ubisoft wants to monitor player engagement across titles such as Rainbow Six Siege. Using an analysis date of 2025-02-01, write a PostgreSQL query that classifies each player according to their most recent session.
2025-02-01.active for fewer than 14 inactive days, at_risk for 14 to 29 days, churned for 30 or more days, and never_played when no session exists.| Column | Type | Description |
|---|---|---|
| player_idPK | INT | Unique player identifier |
| username | VARCHAR(100) | Ubisoft player name |
| region | VARCHAR(30) | Player geographic region |
| Column | Type | Description |
|---|---|---|
| session_idPK | INT | Unique session identifier |
| player_id | INT | Player associated with the session |
| game_title | VARCHAR(100) | Ubisoft game title |
| session_started_at | TIMESTAMP | Session start timestamp |
| platform | VARCHAR(30) | Gaming platform |