Your question is Mining Common Purchase Sequences. 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.
The monday Data Analytics team wants to understand which actions most often lead to a purchase in monday Work Management. Given ordered user events, write a PostgreSQL query that identifies the most common sequence of the three actions immediately preceding a purchase.
user_id and session_id, and order events chronologically using event_time and event_id as a tie-breaker.view_board > open_item > invite_member.| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event identifier |
| user_id | INT | monday user identifier |
| session_id | VARCHAR(50) | Session containing the event |
| event_time | TIMESTAMP | Timestamp when the event occurred |
| action | VARCHAR(50) | Recorded user action |