>> I have a database logging weather data. When a station does not report a
>> temperature, it is set to NULL. It would be a very bad idea to set it to 0
>> as this would ruin the whole statistics.
>> NULL is a perfectly valid information in many cases.
> I'd use -99999.9999, I'd never allow a "i don't know what it is" value
> like Null in my database.
what about a sensor that reports -99999.9999 when it is broken
or the temperature is "out of range" for it? How could you express
this information in this case? Just changing your fake-NULL value
to -88888.8888 would be something *horrible*.
I perfectly agree with Thomas, and I would expand his idea:
- sensor working: integer value between -250~+32767
- sensor now working: integer value less than -250
- sensor unavailable: NULL
I think that the advantages of this kind of architecture are easy to understand.
More generally, NULL means (in this case): I cannot write a *value* because I
have no informations, instead, -99999.9999 is a *value*!
In a previous e-mail on this thread you wrote: "NULL is garbage" or something
like this, but think: -99999.9999 is garbage.
NULL is something we all agree, in general, it means "I don't know".
Going back to the fax-number example, you wrote (if I correctly remember) that
you would use some blanks, instead ... well, I would use a single zero
and another could use some other value.... it would be a disaster!
How could you avoid this?