Re: Inflate a boolean

[prev] [thread] [next] [Date index for 2005/02/21]

From: Johan Lindstrom
Subject: Re: Inflate a boolean
Date: 00:20 on 21 Feb 2005
At 00:35 2005-02-21, Tony Bowden wrote:
> > >That is entirely subjective, and most definitely poor design (in my
> > >opinion) in many cases.
> > Me too. Possibly there would be a value table for that to achieve 3NF.
>
>A table that maps the key "yes" to the value "yes", and the key "no"
>to the value "no"?

Depends. For a boolean value, probably no. For other sets of values, 
possibly yes. Depends on the application. Depends on what you use the 
database for.

For example, let's say I have an Order Type with values like "Credit Card", 
"Wire Order", and fifteen other things. I wouldn't use a varchar(30) for 
that, I would use an "order_type_id int" field and a value table with the 
values "Credit Card", "Wire Order", etc if many different applications on 
top of the database would need to know about this. If there's only one 
application doing this, maybe the mapping would go into the application, 
like the OP intends to do with the boolean <-> yes/no value.

The boolean example is a bit minimal. But I wouldn't store "YES" or "NO" in 
a varchar field.


/J

-------- ------ ---- --- -- --  --  -     -     -        -          -
Johan Lindström    Sourcerer @ Boss Casinos   johanl AT DarSerMan.com

Latest bookmark: "TCP Connection Passing"
http://tcpcp.sourceforge.net/
dmoz: /Computers/Programming/Languages/JavaScript/ 12

(message missing)

Inflate a boolean
adtim 09:08 on 20 Feb 2005

Re: Inflate a boolean
Ofer Nave 09:22 on 20 Feb 2005

Re: Inflate a boolean
Tony Bowden 09:44 on 20 Feb 2005

Re: Inflate a boolean
a.d.tim 10:35 on 20 Feb 2005

Re: Inflate a boolean
Tony Bowden 11:15 on 20 Feb 2005

Re[2]: Inflate a boolean
a.d.tim 12:37 on 20 Feb 2005

Re: Inflate a boolean
Perrin Harkins 21:15 on 20 Feb 2005

Re: Inflate a boolean
Ofer Nave 21:40 on 20 Feb 2005

Re: Inflate a boolean
Tony Bowden 22:07 on 20 Feb 2005

Re: Inflate a boolean
Ofer Nave 22:24 on 20 Feb 2005

Re: Inflate a boolean
Johan Lindstrom 22:47 on 20 Feb 2005

Re: Inflate a boolean
Tony Bowden 23:35 on 20 Feb 2005

Re: Inflate a boolean
Johan Lindstrom 00:20 on 21 Feb 2005

Re: Inflate a boolean
Tony Bowden 09:31 on 21 Feb 2005

Re: Inflate a boolean
=?ISO-8859-1?Q?Ask_Bj=F8rn_Hansen?= 21:25 on 21 Feb 2005

Generated at 12:48 on 22 Feb 2005 by mariachi v0.52