Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Identify Records With Invalid or Unexpected Status Values

EasySQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Identify Records With Invalid or Unexpected Status Values. Start with the requirements and the one table on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

The Apex Systems QA defect tracker requires every defect to use an approved workflow status. Write a PostgreSQL query to identify records whose status is invalid, unexpected, empty, or missing.

Requirements

  1. Return defect_id, status, and summary for every record whose status is not one of new, in_progress, resolved, or closed, including NULL values.
  2. Sort the results by defect_id in ascending order.

Schema

qa_defects
ColumnTypeDescription
defect_idPKINTUnique defect identifier
statusVARCHAR(30)Current defect workflow status
summaryVARCHAR(200)Short description of the defect
created_atDATEDate the defect was created
Tablesqa_defects
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results