Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
SQL Pass Fail by Tester and Date
00:00
5 left

SQL Pass Fail by Tester and Date

MediumSQL · PostgreSQL

Problem

Write a SQL query to summarize pass/fail results by tester and date.

Use the test_results table. Include only rows with a non-null tester, a non-null test date, and a result of pass or fail. Rows with null tester names, null dates, or other result values must be ignored.

Output

  1. One row per tester and test date, with tester_name, test_date, pass_count, fail_count, and total_tests.
  2. Order by tester_name ascending, then test_date ascending.

Schema

test_results
ColumnTypeDescription
result_idPKINTUnique identifier for the test result
tester_nameVARCHAR(50)Name of the tester who ran the test
test_dateDATEDate on which the test was run
resultVARCHAR(30)Outcome of the test execution
Tablestest_results
Interviewer

Your question is SQL Pass Fail by Tester and Date. Start with the requirements and the one table in the Question tab.

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.
CodePostgreSQL
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.