SQLSQL LabPostgreSQL practice
00:0015 / 45
A03Intermediateconditional aggregation

Active incident burden

Return customer_id, open_incidents, and open_sev1_incidents for customers with at least one open incident. Sort by open SEV1 count descending, then customer_id.

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.