EXCEPT

Joining Data in SQL

Maham Faisal Khan

Senior Content Developer, DataCamp

EXCEPT Venn diagram

An image that shows three Venn diagrams, with two faded out. Only the diagram with UNION is in focus. The UNION diagram has two overlapping circles, fully covered in green.

Joining Data in SQL

EXCEPT diagram

A diagram showing two tables, left and right. On the right side of the diagram, there is an illustration of what happens when a UNION operation is performed on the two tables.

Joining Data in SQL

EXCEPT syntax

SELECT monarch, country
FROM monarchs
EXCEPT
SELECT prime_minister, country
FROM prime_ministers;
|------------------|------------------|
| monarch          | country          |
|------------------|------------------|
| Harald V         | Norway           |
| Charles III      | United Kingdom   |
| Willem-Alexander | Netherlands      |
|------------------|------------------|
Joining Data in SQL

Let's practice!

Joining Data in SQL

Preparing Video For Download...