Your question is Second-Highest Booking Value. 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.
Sojern analysts need to validate booking values attributed to the Sojern Travel Marketing Platform. Write a PostgreSQL query that returns the second-highest distinct booking value for completed bookings attributed to that source.
bookings to booking_sources using source_id.Sojern Travel Marketing Platform.| Column | Type | Description |
|---|---|---|
| booking_idPK | INTEGER | Unique booking identifier |
| source_id | INTEGER | Attribution source identifier |
| booking_status | VARCHAR(20) | Booking lifecycle status |
| booking_value | NUMERIC(12,2) | Monetary value of the booking |
| Column | Type | Description |
|---|---|---|
| source_idPK | INTEGER | Unique attribution source identifier |
| source_name | VARCHAR(100) | Marketing or distribution source name |