Given a table of pull request events, write a query to find the average time it takes for a pull request to be merged after its first review.
Use the provided pull request and event data. Include only pull requests with both a valid first review and a later merge event.
average_hours and reviewed_and_merged_prs.average_hours to two decimal places.| Column | Type | Description |
|---|---|---|
| pr_idPK | INT | Unique pull request identifier |
| repository | VARCHAR(255) | GitHub repository name |
| opened_at | TIMESTAMP | Time the pull request was opened |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event identifier |
| pr_id | INT | Pull request associated with the event |
| event_type | VARCHAR(50) | Type of pull request event |
| event_at | TIMESTAMP | Time the event occurred |