SQL NULL Values

Null values is field that has no value. If a field in a table is optional, we can insert a new record or update record without adding a value to this field.

IS NULL

Syntax
<?php  

    SELECT column_names
	FROM table_name
	WHERE column_name IS NULL; 

?>


Example
<?php  

    SELECT CustomerName, ContactNo, Address
	FROM Customers
	WHERE ContactNo IS NULL;

?>

NOT NULL

Syntax
<?php  

    SELECT column_names
	FROM table_name
	WHERE column_name IS NOT NULL;

?>


Example
<?php  

    SELECT CustomerName, ContactNo, Address
	FROM Customers
	WHERE ContactNo IS NOT NULL;

?>