SQLSQL LabPostgreSQL practice
00:0021 / 45
C02IntermediateUNION · set operations

Customers needing attention

Return distinct customer_id values for customers that have either a failed deployment or an open sev1 incident. Use a set operation and sort by customer_id.

Data available

Use these tables

2 tables · 1 relationship
Table 1

deployments

Customer releases, including failures and rollbacks.

  • deployment_idintegerPK
  • customer_idintegerFK
  • engineer_idintegerFK
  • versiontext
  • statustext
  • deployed_attimestamptz
Table 2

incidents

Operational incidents; unresolved rows have no resolved_at.

  • incident_idintegerPK
  • customer_idintegerFK
  • deployment_idintegerNULLFK
  • severitytext
  • opened_attimestamptz
  • resolved_attimestamptzNULL
  • root_causetextNULL
How the tables connect
incidents.deployment_id=deployments.deployment_id
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.