Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Get started
Work With Data
00:00
5 left

Work With Data

MediumSQL · PostgreSQL

Problem

Tell me about a time you had to work with a set of data.

Using the provided dataset metadata and records, write a SQL query that identifies datasets with at least two valid records and summarizes those records.

Output

  1. One row per qualifying dataset.
  2. Columns: dataset_name, owner_name, valid_record_count, average_value, and latest_record_date.
  3. Include only records whose status is valid; exclude datasets with fewer than two valid records.
  4. Order by valid_record_count descending, then dataset_name ascending.

Schema

data_sets
ColumnTypeDescription
dataset_idPKINTUnique identifier for a dataset
dataset_nameVARCHAR(100)Name of the dataset
owner_nameVARCHAR(100)Person responsible for the dataset
data_records
ColumnTypeDescription
record_idPKINTUnique identifier for a data record
dataset_idINTDataset associated with the record
record_dateDATEDate on which the record was collected
statusVARCHAR(20)Validation status of the record
record_valueDECIMAL(10,2)Numeric value stored in the record
Tablesdata_setsdata_records
Interviewer

Whenever you're ready, walk me through your approach or go straight to the code. The requirements and the two tables are in the Question tab.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.