Re: The BOOLEAN data type

From: Bob Badour <bbadour_at_golden.net>
Date: Thu, 3 Apr 2003 21:33:42 -0500
Message-ID: <0K6ja.94$LG4.5065812_at_mantis.golden.net>


"Dieter Nöth" <dnoeth_at_gmx.de> wrote in message news:b6gr24$5797t$1_at_ID-28204.news.dfncis.de...
> Costin Cozianu wrote:
> > Let there be a a panel of judges who will "judge" if Joe Celko's
> > contributions to the above threads are "good" as opposed to "bad"
> > (unreasonable, misleading, containing bad advice).
>
> You already say that there are many different "bads", so why not using
> different values indicating "unreasonable", "misleading", "containing
> bad advice", "good", "excellent"... instead of black/white, yes/no?
> Or similar to school marks "A" to "F"?
>
> > Here's a minimal and natural solution with the boolean data types. I
> > leave the constraints as an exercise for the reader, because you made
> > SQL way too verbose for me to bother :)
> >
> > CREATE TABLE THREADS (
> > thread_id varchar,
> > thread_subject varchar)
> >
> > CREATE TABLE JUDGES (
> > judge varchar
> > )
> >
> > CREATE TABLE JUDGEMENTS (
> > thread_id varchar,
> > judge varchar,
> > is_good boolean
> > )
> >
> > and then I'd insert for this particular thread:
> >
> > INSERT INTO JUDGEMENTS
> > VALUES ( 'W1Hia.19%243l2.962647%40mantis.golden.net', 'Costin
> > Cozianu', false )
> >
> > If I want to say that your contribution is good I'd put a "true". If I
> > am in doubts or have mixed feelings, I don't want to pronounce, I won't
> > insert anything.
> >
> > Voila: a natural usage of boolean datatype, *and* there are no NULLs in
> > the table, and no NULLs are ever needed in this case. Plus the schema is
> > very easy to use in programs, queries, reports, OLAP thingies :)
>
> If you don't insert anything it's a NULL ;-)

An empty set is different from NULL. Perhaps, you should pay more attention to Costin and less attention to Joe. Received on Fri Apr 04 2003 - 04:33:42 CEST

Original text of this message