In a (relational) database, NULL indicates that a field does not have a value.
Usual arithmetic rules do not apply to NULL values:
- Almost all calculations involving NULL values gives NULL as result, for example
5 + NULL has the result NULL. String concatenation does not always work this way, for example the Oracle operator for concatenating strings, ||, treats NULL as an empty string.
- No value is equal to NULL, not even NULL itself! Therefore there is a special
<value> IS NULL operator that is used to test for NULL values.
Note: On some database servers, for example Oracle 8, an empty string is equal to null, but on others, for example Microsoft SQL Server, an empty string is not equal to null (but that is configurable, IIRC).