Re: The BOOLEAN data type
Date: 17 Apr 2003 15:19:00 -0700
Message-ID: <c0d87ec0.0304171419.5e325239_at_posting.google.com>
>> Well.... SQL has many faults, one of them being the value of having
a
NULL datatype. <<
It is not a datatype! It is not a data value! It is a marker for a missing value. These differences are important.
>> While I tend to agree that nulls in basetables are of little or no
value, I do see the NULL value as a reasonable way to support outer
joins. <<
While I want to have DEFAULT or NOT NULL whenever possible, NULLs can be useful in tables. My favorite is as an "eternity symbol" in durations:
CREATE TABLE Foobar
(...
start_date DATE DEFAULT CURRENT_TIMESTAMP NOT NULL,
end_date DATE, -- null means on-going event
CHECK(start_date <= end_date),
...);
>> This terrible of treating null-values with propagation is just
incoherent, however. Who ever invented that? <<
Dr. Codd. He later had two nulls -- missing value, and missing attribute
>> While meaningful for e.g. arithmetic values (null + x is clearly
null, and it seems reasonable to treat null*x = null even though this
is incoherent if x = 0), <<
Try (null/0); a lot of SQL products got it wrong. You are assuming that a NULL is a value of a numeric datatype, so that the laws of arithemetic apply. It is not a numeric; it has no datatype at all.
>> Why does SQL not use three-valued logic? <<
Dr. Codd and the NULLs required it. Received on Fri Apr 18 2003 - 00:19:00 CEST