In MySQL, NULL represents an unknown value. A NULL is never equal to any, even another NULL. Operator returns true if column value is NULL.
Step 1 - First we will create the database.
Here I created the database with name mindcracker.
Step 2 - Now we will create the table.
So our table student is created.
Step 3 - Now we will insert values in our table.
So here is the created table.
Step 4 - Now we write the following MySql query to fetch the student where name is NULL.
Summary
Here we see that to fetch the student with NULL value we have not write the select query like this
- select * from student where name=NULL;
Because we know that NULL value can't be equal to a value. So to fetch the student with
NULL value we have to use is keyword with where clause in select statement.