SQLSQL LabPostgreSQL practice
00:0040 / 45
O03AdvancedLEAD · CTE

Recovery after failed releases

For each failed deployment, inspect the customer’s next deployment. Return deployment_id, customer_id, deployed_at, next_status, and next_deployed_at. Exclude failures with no later deployment and sort by deployment_id.

Data available

Use this table

1 table
Table 1

deployments

Customer releases, including failures and rollbacks.

  • deployment_idintegerPK
  • customer_idintegerFK
  • engineer_idintegerFK
  • versiontext
  • statustext
  • deployed_attimestamptz
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.