This tutorial explains how to use the MySQL IS NULL condition with syntax and examples.
The MySQL IS NULL Condition is used to test for a NULL value in a SELECT, INSERT, UPDATE, or DELETE statement.
The syntax for the IS NULL Condition in MySQL is:
The value to test if it is a NULL value.
Let's look at an example of how to use MySQL IS NULL in a SELECT statement:
This MySQL IS NULL example will return all records from the contacts table where the last_name contains a NULL value.
Next, let's look at an example of how to use MySQL IS NULL in an INSERT statement:
This MySQL IS NULL example will insert records into the contacts table where the category contains a NULL value.
Next, let's look at an example of how to use MySQL IS NULL in an UPDATE statement:
This MySQL IS NULL example will update records in the contacts table where the last_name contains a NULL value.
Next, let's look at an example of how to use MySQL IS NULL in a DELETE statement:
This MySQL IS NULL example will delete all records from the contacts table where the last_name contains a NULL value.