thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Data & Analytics · Advanced

Semi Join

A join pattern that returns rows from one table that have at least one match in another, without duplicating them.

Definition

Semi joins are written with EXISTS or IN, or LEFT SEMI JOIN in Spark. Unlike an inner join, a semi join returns each left row once no matter how many matches exist, and it returns no columns from the right table.

Example

SELECT * FROM Customers WHERE CustomerID IN (SELECT CustomerID FROM Orders);

Exam tip

Use a semi join (EXISTS) when an inner join would duplicate left-side rows.

Related terms