Your question is SQL Average Support Response Time. 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.
Write an SQL query to calculate the average response time for customer support tickets over the last month.
Assume response time means the elapsed time from ticket creation to the first recorded response. Use the previous rolling month based on CURRENT_DATE and exclude tickets without a response.
average_response_time_minutes.| Column | Type | Description |
|---|---|---|
| ticket_idPK | INT | Unique support ticket identifier |
| created_at | TIMESTAMP | Timestamp when the ticket was created |
| status | VARCHAR(30) | Current ticket status |
| channel | VARCHAR(30) | Support channel used to create the ticket |
| Column | Type | Description |
|---|---|---|
| response_idPK | INT | Unique response identifier |
| ticket_id | INT | Ticket associated with the response |
| response_at | TIMESTAMP | Timestamp when the response was recorded |
| response_type | VARCHAR(30) | Type of support response |