SQL VALUE NULL

NULL represents an unknown value.

This value can be assigned as NULL value to any column in a table.

If the value of a column is optional, means that we can insert a row into the table without assigning any value to that column optional, so this column will be set to NULL.

The null is a special value, and therefore can not be compared with the normal arithmetic operators (=,>, <, <>), and instead we must use the IS and IS NOT operators.

In the table people, we have the column 'nickname' which is optional and can have null values:

namesurnamenicknameage
HARRYCLARK30
WILLIAMJONESCLARK45
HARRYSMITH50

Example of using IS NULL

SELECT * FROM people WHERE nickname IS NULL
namesurnamenicknameage
HARRYCLARK30
HARRYSMITH50

Example of use of IS NOT NULL

SELECT * FROM people
WHERE nickname IS NOT NULL
namesurnamenicknameage
WILLIAMJONESCLARK45