News for hackers. Stuff that matters.
Re:Easy Steps to a Complete Understanding of SQL by dragonwriter on Tuesday September 03, 2013 @12:49PM (#6322006)
The two main meanings of NULL are "Does not exist" and "Exists but is unknown", though there are more.
Re:Easy Steps to a Complete Understanding of SQL by yawaramin on Tuesday September 03, 2013 @03:28PM (#6323158)
Also, `we don't know if it exists'.
Re:Easy Steps to a Complete Understanding of SQL by epo on Tuesday September 03, 2013 @04:17PM (#6323469)
NULL is a marker that means this data value does not exist in the database.

Your second, and any other 'meanings' are a misuse of NULL, which is your fault, not SQLs

Re:Easy Steps to a Complete Understanding of SQL by dragonwriter on Tuesday September 03, 2013 @04:56PM (#6323685)
> NULL is a marker that means this data value does not exist in the database.

Both of the uses I stated are data values that do not exist in the database.

> Your second, and any other 'meanings' are a misuse of NULL

No, they aren't. They are different, and substantively different, reasons why data does not exist in a database. One is the value does not exist in the domain of which the DB is model, and one is that the value exists in that domain but it is not known.

(Others have pointed out the additional case of "we do not know if it exists", which is ambiguity between those two cases.)

These two substantially different meanings of NULL were recognized fairly early in the history of the relational model by the creator of the model (E.F. Codd), who proposed refining the model by having separate markers for each of those two cases.

Re:Easy Steps to a Complete Understanding of SQL by einhverfr on Tuesday September 03, 2013 @09:20PM (#6324972)
NULL can mean a bunch of things:

1. Value is unknown

2. Value does not exist (for example, outer join results).

These have ery different implications. For example:

somestring || does_not_exist you would think would equal somestring, but with unknown we dont know.

Re:Easy Steps to a Complete Understanding of SQL by ams6110 on Wednesday September 04, 2013 @01:33AM (#6325759)
It doesn't exactly mean that the value does not exist, it's that it's unknown whether it exists. NULL means nothing at all, not the absence of a value (though applications will often abuse it to mean that, and pragmatically that's usually OK).