MySQL: IS NULL Condition

Profile picture for user arilio666

The IS NULL is a condition used in MySQL to fetch the record of data in a table where there is null value or absent or we can also say incomplete value present. These incomplete data can sometimes be asked about and IS NULL is the best query to fetch the records of data that is null.

Syntax

SELECT * from TableName WHERE ColumnName IS NULL;

We will use the orders table for this example:

Today we will be doing some basic operations using IS NULL: We will be fetching orders which are not shipped from the orders table.

Example

select * from orders where shipped_date IS NULL;

As we can see the shipped date are the orders which are successfully delivered date as we need to fetch orders that are not shipped we can use the IS NULL condition to fetch the dates which are null meaning that they are not shipped.

Tags