Welcome to the SQL screen.
The question is on your right: Daily Peak-Hour Driver Acceptance Rate. Read through the requirements and the three tables first.
Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?
You are given ride request and driver response data from Lyft. Write a query to calculate the daily driver acceptance rate for rides requested in San Francisco during peak hours. Treat peak hours as 7:00-9:59 and 16:00-18:59 based on the ride request timestamp. The acceptance rate should be the number of requested rides with at least one accepted driver response divided by the total number of qualifying ride requests for each day.
| Column | Type | Description |
|---|---|---|
| request_idPK | INT | Unique ride request identifier |
| rider_id | INT | Rider who placed the request |
| requested_at | TIMESTAMP | Timestamp when the ride was requested |
| city_id | INT | City where the ride was requested |
| ride_type | VARCHAR(50) | Requested Lyft product type |
| Column | Type | Description |
|---|---|---|
| city_idPK | INT | Unique city identifier |
| city_name | VARCHAR(100) | City name |
| state_code | VARCHAR(10) | State abbreviation |
| Column | Type | Description |
|---|---|---|
| response_idPK | INT | Unique driver response identifier |
| request_id | INT | Ride request tied to the response |
| driver_id | INT | Driver who received the request |
| response_status | VARCHAR(20) | Driver response outcome |
| responded_at | TIMESTAMP | Timestamp of the driver response |