Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
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 feedbackCoaching1:1 coaching with people at your target companiesSuccess 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
SQL Join to Find Missing Rows
00:00
5 left

SQL Join to Find Missing Rows

EasySQL · PostgreSQL

Problem

There is a list of SQL operations across multiple tables; write the final SQL to select records from table 1 that do not have a record in table 2.

Use the provided schemas and match records by record_id and table_1_id.

Output

  1. One row per unmatched table_1 record.
  2. Return record_id, record_name, and source_system.
  3. Sort by record_id in ascending order.

Schema

table_1
ColumnTypeDescription
record_idPKINTUnique identifier for a table_1 record
record_nameVARCHAR(100)Display name of the record
source_systemVARCHAR(50)System that supplied the record
table_2
ColumnTypeDescription
table_2_idPKINTUnique identifier for a table_2 record
table_1_idINTReferenced record_id from table_1
noteVARCHAR(200)Optional note associated with the table_2 record
Tablestable_1table_2
Interviewer

Your question is SQL Join to Find Missing Rows. Start with the requirements and the two 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.