IS NULL & IS NOT NULL Operators in SQL?

By Hemanta Sundaray on 2022-12-11

In SQL, unknown values are indicated by NULL.

It is not possible to test for NULL values with comparison operators, such as = and !=.

Instead, we will have to use these operators:

  • IS NULL
  • IS NOT NULL

For example, the following statement filters for all movies that have an IMDb rating:

SELECT name
FROM movies
WHERE imdb_rating IS NOT NULL;

Join the Newsletter