SQLSQL LabPostgreSQL practice
00:0034 / 45
T02Advancedintervals · EXTRACT

Mean time to resolution

For resolved incidents, return severity and avg_resolution_hours, rounded to two decimals. Sort sev1, sev2, then sev3.

Data available

Use this table

1 table
Table 1

incidents

Operational incidents; unresolved rows have no resolved_at.

  • incident_idintegerPK
  • customer_idintegerFK
  • deployment_idintegerNULLFK
  • severitytext
  • opened_attimestamptz
  • resolved_attimestamptzNULL
  • root_causetextNULL
Query editor

PostgreSQL

Run query
Result stream

Output

Run your query to inspect its result.
Contextual coach

Ask about this attempt

Run or check a query first. The coach only comments on a real error or grader mismatch.

Field notes

Hints & explanation

Try to solve it cold. Two progressive hints are available.