Re: Can we solve this -- NFNF and non-1NF at Loggerheads

From: Alan <not.me_at_rcn.com>
Date: Wed, 9 Feb 2005 06:50:11 -0500
Message-ID: <36ubo5F542hdqU1_at_individual.net>


"strider5" <strider5_at_szm.com> wrote in message news:1107851456.257088.7580_at_c13g2000cwb.googlegroups.com...
> >value of any attribute in a tuple must be a single value from
> >the domain of that attribute
>
> That is IMHO the key point - nothing stops you to define a domain which
> values are e.g. arrays of chars
> (widely recognised as varchar).
> Then varchar from one point of view is indivisible, OTOH everybody in
> this NG knows what SUBSTRING is...
>

"Indivisible" does not mean that it cannot be parsed out into component characters. It means _conceptualy_, the piece of data represented can/should not be divided. Again, the phone number example is good. Depending on the need, a full 10 digit phone number can be regarded as indivisible or not. At my workplace, a 10 digit phone number is indivisible. Other companies would need to view the area code distinctly from the phone numbner, so in that case, phone number is not indivisible (is divisible). In that case, there would be two indivisible attributes, area_code and phone_number.

Now, at my company should I suddenly find myself frequently needing to use SUBSTRING() on phone_number to extract the area_code, then it may pay to change things and add an area_code attribute.

Also, I don't know that VARCHAR is any more or less an array than CHAR. The main difference between the two is that VARCHAR(length) does not reserve (length) amount of space. Instead, the length parameter acts as a maximum length constraint. CHAR(length) always allocates the length and pads with spaces to the right. FWIW, I don't think of either type as arrays. A programmer might, but from a database perspective, they are just data types. Received on Wed Feb 09 2005 - 12:50:11 CET

Original text of this message