Path: news.cambrium.nl!textnews.cambrium.nl!feeder2.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.246.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!n3g2000yqb.googlegroups.com!not-for-mail
From: Tony Andrews <tony.andrews.1@gmail.com>
Newsgroups: comp.databases.theory
Subject: Re: boolean datatype ... wtf?
Date: Thu, 30 Sep 2010 03:32:58 -0700 (PDT)
Organization: http://groups.google.com
Lines: 30
Message-ID: <c0d584e9-3395-47d6-96f2-539c515bc72b@n3g2000yqb.googlegroups.com>
References: <ZQqoo.1282$89.506@edtnps83> <8b7a5a2a-1f5b-4778-8238-ca8bd7a00720@a36g2000yqc.googlegroups.com>
 <3cb332c4-ae45-418d-a1e1-250f42ca52e6@k10g2000yqa.googlegroups.com> <bba9fa59-d83d-4467-8514-acd82dc09ad4@k17g2000prf.googlegroups.com>
NNTP-Posting-Host: 86.4.16.42
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1285842779 1750 127.0.0.1 (30 Sep 2010 10:32:59 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 30 Sep 2010 10:32:59 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: n3g2000yqb.googlegroups.com; posting-host=86.4.16.42; posting-account=gSj7NQkAAABlAuBZQxQ3wuVlG7yuQVHa
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.10)
 Gecko/20100914 Firefox/3.6.10 ( .NET CLR 3.5.30729; .NET4.0E),gzip(gfe)
Xref:  news.cambrium.nl

On Sep 30, 7:03=A0am, David BL <davi...@iinet.net.au> wrote:
> On another note, I can easily imagine applications with boolean
> attributes that cannot be regarded as derived or calculated from other
> information recorded in the database. =A0E.g. soft cover versus hard
> cover, read versus unread, fiction versus non-fiction for a book.

I am with you there, even though it could be argued that you could
have cover_type=3D'soft', status=3D'read', classification=3D'fiction' etc.
instead.  A pretty common "real world" example in my experience would
be where we have to design a database to record data gleaned from the
public via a paper or web-based form with lots of "checkbox" questions
- e.g. for a car insurance application:
[ ] Is the car kept in a locked garage overnight?
[ ] Does the car have an immobiliser fitted
[ ] Have you made a claim in the past 3 years
... and so on for dozens of questions to which the business needs to
know just the Boolean answer.

We could again introduce a lot of specific domains like garaged_status
('GARAGED','NOT GARAGED'), but I'm not sure what would be gained by
that.  Or we could create a plethora of tables like:
 create table applications_with_garages (application_id references
applications primary key);
 create table applications_with_immobolisers (application_id
references applications primary key);
... etc.

That may be the right approach in a theoretical true RDBMS, but I'm
pretty sure it would get me sacked as a lunatic in any SQL-based DBMS
team!
