SQL's null is a value. The difference is that processing null values does not cause exceptions in SQL.
In Db land you can make a column not nullable. Bit the SQL languages like PLSQL TSQL etc have the same issue.
- the results of any operations over nulls run as if the pointer were not null
- while anyhing you do in SQL with NULL would explicitly have a mapping to either a correct value or another NULL
This is all said knowing that it’s quite easy to understand why is that the case.It is known to be one of the major controversies because originally NULL means the absence of a value which entails that it is not a value. Hence, if there are no values, then we cannot do any operations. Yet, for whatever reason (avoiding exceptions etc.) expressions with NULL need to be evaluated and hence NULL is treated as a value. So we get a problem: NULL is not a value AND NULL is a value. There are different views on this problem and the solution implemented in SQL (and three-valued logic) is probably not the best one.
SQL is pretty clear what null is:
> “Every [SQL] data type includes a special value, called the null value,”[0] “that is used to indicate the absence of any data value”[1]
(http://modern-sql.com/concept/null)
[0] SQL:2011-1: §4.4.2 [1] SQL:2011-1: §3.1.1.12
A database sometimes needs to model this case: the value is unknown: maybe the paper file you digitized was corrupted or destroyed, or other valid reasons this value is not known.
Whereas null references can be avoided, like in rust etc.
Rust or functional languages show you do not generally need null references, you have options instead. It is completely different.
Null in C or C++ is much more a very costly misstake. Missing data is just reality.
Data may be incomplete, the values unknown. SQL is designed for that. It is designed to handle reality. Whereas null references are not, they cause problems you do not need...
Data != reference
you can avoid the issue of allowing invalid references everywhere
you can not avoid incomplete data.