Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
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
Experiences
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
Build my plan
Project Data Collection With SQL
00:00
5 left

Project Data Collection With SQL

MediumSQL · PostgreSQL

Problem

Tell me about your projects and how you collect, clean, and manipulate data using SQL.

Use the provided project, batch, and cleaning-event tables to demonstrate the SQL work behind that process. Write a query that summarizes first-quarter 2025 collection and cleaning activity for every project.

Output

  1. One row per project, including projects without qualifying batches.
  2. Return project_id, project_name, collected_rows, valid_rows, cleaned_rows, validation_rate, and latest_cleaned_at.
  3. Treat missing numeric totals as zero, return NULL for validation_rate when no rows were collected, and order by project_id ascending.

Schema

projects
ColumnTypeDescription
project_idPKINTUnique project identifier
project_nameVARCHAR(100)Project name
owner_nameVARCHAR(100)Project owner
data_batches
ColumnTypeDescription
batch_idPKINTUnique collected data batch identifier
project_idINTProject associated with the batch
source_nameVARCHAR(100)Data collection source
collected_atDATEDate the batch was collected
rows_collectedINTNumber of rows collected
rows_validINTNumber of rows passing validation
cleaning_events
ColumnTypeDescription
event_idPKINTUnique cleaning event identifier
batch_idINTBatch affected by the event
event_typeVARCHAR(50)Type of cleaning or validation action
affected_rowsINTNumber of rows affected
event_dateDATEDate of the cleaning event
Tablesprojectsdata_batchescleaning_events
Interviewer

Your question is Project Data Collection With SQL. Start with the requirements and the three tables 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
Sign up free to run your codeLog inLn 1
Run your query to see results here.