Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Count Open Defects by Severity

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

Your question is Count Open Defects by Severity. 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

You are given a table of defect records from a BAE Systems USA engineering tracking workflow. Write a SQL query to return the number of open defects for each severity, sorted by the defect count from highest to lowest. Ignore rows where severity is NULL.

Schema

defects
ColumnTypeDescription
defect_idPKINTUnique defect record ID
program_nameVARCHAR(100)Program or platform name
severityVARCHAR(20)Defect severity level
statusVARCHAR(20)Current defect status
reported_dateDATEDate the defect was reported
Tablesdefects
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results