Re: boolean datatype ... wtf?

From: Paul Mansour <psmansour2000_at_yahoo.com>
Date: Wed, 29 Sep 2010 07:41:31 -0700 (PDT)
Message-ID: <01295a7a-0b0f-4fdc-bcc3-8d95e14ead79_at_h7g2000yqn.googlegroups.com>


On Sep 29, 8:48 am, Erwin <e.sm..._at_myonline.be> wrote:
> On 29 sep, 13:51, Paul Mansour <psmansour2..._at_yahoo.com> wrote:
>
>
>
> > What is the problem with a Boolean data type?
> > .
> > It is fundamental - so fundamental  that in TTM it is the only
> > required scalar data type:  “We require that at least one built-in
> > scalar type be supported : Namely, type “Boolean” (BOOLEAN in Tutorial
> > D”).
>
> It is fundamental _FOR A COMPUTING LANGUAGE_ because that computing
> language might have a need for evaluating some expression that follows
> the 'IF' (or for evaluating a ternary operator of the style <xpr> ?
> result1 : result2).
>
> It is, imo, _NOT_ fundamental in the context of actual database
> design.  In fact, I think that the justifiable cases for including a
> BOOLEAN in an actual database design (not talking of derived relvars
> aka views) are few and far between, if existant at all.  I think that
> is precisely what VT was talking of: the RM already has a way for
> representing truth information (as the presence/absence of some tuple
> in some relvar with some particular predicate), and as a consequence
> the type BOOLEAN (_WITHIN DATABASE RELVARS_) must be considered
> redundant and unnecessary.
>
> That the relation type {} has the same cardinality as the set of 2VL
> truth values, and that therefore, when amended/augmented/provided with
> a proper set of operators, it is isomorphic to boolean algebra, seems
> all too obvious.  Whether that can be exploited usefully in the design
> of a language that wants to eliminate true and false (as such, only to
> replace those with DEE and DUM), is a bit less obvious.

Erwin, I don't disagree that a boolean type may be rarely if ever necessary in a base relation. But it seems somewhat awkard and artificial to allow them in derived relvars and not database relvars. And they occur whether one wants them to or not if you have a where or a having clause.

I also realize that there is a distinction between database design, and something like tutorial D, a language interface to a DMBS. But it does not seem unresonable to say that boolean types are fundamental to relational database theory and to any RDMS, even if that RDMS does not have an explicit boolean type available to the user (wrongly, I think). Maybe that is only because they are fundamental to the language interface, but that seems like a distinction without much difference. Received on Wed Sep 29 2010 - 16:41:31 CEST

Original text of this message