Search ⌘K
O
Oracle

Interview Core Track · Easy · 15 min

10. Determine Records in One Table Not Present in Another

To find records in one table that aren't in another, you can use a LEFT JOIN and check for NULL values in the right-side table. Here is an example using two ...

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 Oracle-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 find records in one table that aren't in another, you can use a LEFT JOIN and check for NULL values in the right-side table. Here is an example using two tables, oracle_employees and oracle_managers: SELECT * FROM oracle_employees LEFT JOIN oracle_managers ON oracle_employees.id = oracle_managers.id WHERE oracle_managers.id IS NULL; This will return all rows from oracle_employees where there is no matching row in managers based on the id column. You can also use the EXCEPT operator in PostgreSQL and Microsoft SQL Server to return the records that are in the first table but not in the second. Here is an example: SELECT * FROM oracle_employees EXCEPT SELECT * FROM oracle_managers This will retrieve all rows from employees that do not appear in managers. The EXCEPT operator works by retrieving the rows that are returned by the first query, but not by the second. Please note that EXCEPT is not supported by all DBMS systems, such as MySQL and Oracle (however, you can use the MINUS operator to achieve a similar outcome). ---

oracle_employees
id INTEGER PRIMARY KEY
name VARCHAR(100
oracle_managers
id INTEGER PRIMARY KEY
name VARCHAR(100
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.