User System Response Times
Start Timer
0:00:00
You have been provided with two tables: conversation_messages and interviews.
Write a query to compute the average time it takes for each user to respond to the previous system message. The message type is described in the message_type field where it could be either user or system indicating who sent the message.
Example:
Input:
conversation_messages table
| Column | Type |
|---|---|
| id | int |
| created_at | timestamp |
| updated_at | timestamp |
| text | text |
| message_type | varchar(255) |
| interview_id | int |
interviews table
| Column | Type |
|---|---|
| id | int |
| created_at | datetime |
| updated_at | datetime |
| user_id | int |
Example Output:
| user_id | response_times |
|---|---|
| 1 | 60.00 |
| 2 | 120.00 |
.
.
.
.
.
.
.
.
.
Comments