Your question is SQL for Weekly Performance. 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.
Clear Operations needs a weekly view of performance across Clear locations. Write a PostgreSQL query that reports completed transaction volume, average customer wait time, and the week-over-week change in completed transactions for each location.
completed.NULL when no prior week exists.| Column | Type | Description |
|---|---|---|
| location_idPK | INT | Primary key for the Clear location |
| location_name | VARCHAR(100) | Name of the Clear location |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Primary key for the transaction |
| location_id | INT | Location associated with the transaction |
| status | VARCHAR(20) | Transaction processing status |
| completed_at | TIMESTAMPTZ | Timestamp when the transaction completed |
| wait_minutes | INT | Customer wait time in minutes |