SQL Null Values
The SQL NULL value condition used to check a NULL value in a table if the query returns TRUE means the NULL value is found otherwise the query returns FALSE if the NULL values are not found.
This condition will work when a field is optional in a table suppose, to insert a new record in a table without adding a value to optional field then, the field will be saved with a NULL value.
NULL Value Syntax
Use IS NULL Operatoe to find NULL Values, and IS NOT NULL Operator to find NOT NULL values.
IS NULL Condition
SELECT Column_Name
FROM Table_Name
WHERE Column_Name IS NULL;
IS NOT NULL Condition
SELECT Column_Name
FROM Table_Name
WHERE Column_Name IS NOT NULL;
Difference Between IS NULL & IS NOT NULL
- Use IS NULL condition to get the Null values in the SQL table.
- IS NULL condition is used as the comparison operator in SQL.
- IS NOT NULL condition used to test fro Non-Empty values.