Search ⌘K
Databricks
Databricks

Interview Core Track · Easy · 15 min

3. How do you identify records in one table that aren't in another

To discover records in one table that are not present in another, you can utilize a LEFT JOIN and filter out any NULL values in the right-side table. For exa...

Interview Core Track
Easy
15 min
joins
filtering

Company labels are directional practice context, not official interview guidance.

Timer 00:00
Back to practice

Objective

Practice joins through a Databricks-tagged business scenario.

Approach

Use this track to improve speed, edge-case handling, and accuracy under timed conditions.

Company context

Company labels are directional practice context, not official interview guidance.

Prereq: query basics
Prereq: filtering

To discover records in one table that are not present in another, you can utilize a LEFT JOIN and filter out any NULL values in the right-side table. For example, say you had a table of Databricks customers and a 2nd table of all purchases made with Databricks. To find all customers who did not make a purchase, you'd use the following LEFT JOIN SELECT * FROM customers c LEFT JOIN purchases p ON c.id = p.customer_id WHERE p.id IS NULL; This query fetches all rows from the customers table, along with any rows that match in the purchases table. If there is no matching row in the purchases table, NULL values will be returned for all of the right table's columns. The WHERE clause then filters out any rows where the purchases.id column is NULL, leaving only customers who have not made a purchase. ---

customers
id INT PRIMARY KEY
name VARCHAR(100
purchases
id INT PRIMARY KEY
customer_id INT
amount DECIMAL(10
2
Editor
SQL workspace

Run queries against the protected question data, then submit once the result shape looks right.

Sign in to run SQL

Create a free account or sign in before running queries against protected question data.