Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Counting Rows in a Table

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

Your question is Counting Rows in a Table. 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 Aristocrat QA team stores automated and manual test executions for the Oasis casino management system in a single table. Write a PostgreSQL query that returns the total number of test execution records.

Requirements

  1. Count every row in oasis_test_runs, including rows where optional columns contain NULL.
  2. Return one row with the result aliased as total_rows.

Schema

oasis_test_runs
ColumnTypeDescription
test_run_idPKINTEGERUnique test execution identifier
test_suiteVARCHAR(100)Name of the QA test suite
environmentVARCHAR(30)Environment where the test ran
execution_statusVARCHAR(20)Test result status
executed_byVARCHAR(100)Person or automation process that executed the test
Tablesoasis_test_runs
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results