Back to Yugabyte Db

IS NULL

community/learn/content/01-SQL-Basics/02-fundamentals/10-is-null.md

2026.1.0.0-b29656 B
Original Source

SELECT with a IS NULL operator

In this exercise we will query the customers table and find all the customers who do not have a region assigned to them.

SELECT contact_name,
       contact_title,
       city,
       country,
       region
FROM customers
WHERE region IS NULL;

This query should return 60 rows

SELECT with a IS NOT NULL operator

In this exercise we will query the customers table and find all the customers who do have a region assigned to them.

SELECT contact_name,
       contact_title,
       city,
       country,
       region
FROM customers
WHERE region IS NOT NULL;

This query should return 31 rows