Your question is Find Second Most Recent Subscription. 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 wants to review the second most recent subscription event for each account in Adobe Experience Cloud. Write a SQL query to return that event per user.
user_id by event_timestamp in descending order.| Column | Type | Description |
|---|---|---|
| event_idPK | BIGINT | Primary key for the event |
| user_id | BIGINT | Adobe account identifier |
| subscription_id | BIGINT | Subscription record identifier |
| event_type | VARCHAR(50) | Event type, such as start, renewal, or cancel |
| event_timestamp | TIMESTAMP | When the subscription event occurred |
| channel | VARCHAR(50) | Source channel, such as web, mobile, or partner |