IS Null in SQL
Written By:- Isha MalhotraWhat is NULL
Null is undefined value. If do not have any data for any column and we also don’t have any default value for that column, then we insert null in that column.
Example of IS NULL
Check the data of following table:-
Figure 1
In this table you can see that in enq_type column we have entered null as we don’t have any value for this row.
IS NULL Operator
Now if we need to select data which is have Null in enq_type then we will use IS NULL operator in the following manner
select * from enqdata where enq_type is null
After running this query it will show result as follows:-
Figure 2
IS NOT NULL Operator
Now if you want to select all data except null then we will use this operator with not in the following manner
select * from enqdata where enq_type is not null
and you will get following output: -
Figure 3