SQL IS NULL Operator | Querying Data from Single Table

SQL IS NULL Operator: To check for empty values (NULL values) in a database table column, we use the SQL IS NULL operator.

SQL IS NULL Operator

To check for empty values (NULL values) in a database table column, we use the SQL IS NULL operator. This is a logical operator that works as follows:

What Is NULL?

  • NULL in SQL means that the data is missing or unknown.
  • It shows that a field was not filled in or that the value does not apply.
  • A NULL value is not the same as a zero value or blank spaces.

— 1. It is used to get details of any table who don’t have any values or specified as null values (1st query).

— 2. You can also use IS NOT NULL to get opposite result of the IS NULL value (2nd query). Click for more!

SQL Example 1:

SELECT *
FROM customers
WHERE phone IS NULL;
SQL IS NULL Operator

SQL Example 2:

SELECT *
FROM customers
WHERE phone IS NOT NULL;
SQL IS NULL Operator

Watch Video!

Next Post >> #2.10) ORDER BY Clause

<<Previous Post #2.8) SQL REGEXP Operator

Vickey Rajpoot
Vickey Rajpoot

Hello there! I'm dedicated Microsoft Data & AI Engineer at LTIMindtree, where I thrive technology into actionable insights. Dive into my world by visiting my YouTube channel & Webiste, "Kingfisher Tech Tips".

Articles: 96

Leave a Reply

Your email address will not be published. Required fields are marked *