Re: MV Keys

From: David Cressey <dcressey_at_verizon.net>
Date: Wed, 01 Mar 2006 11:26:48 GMT
Message-ID: <YxfNf.7285$FY1.7091_at_trndny06>


"Bob Hairgrove" <invalid_at_bigfoot.com> wrote in message news:3bla025sc4m8u59a7qoc09bipjtnh5tmuk_at_4ax.com...
> On 28 Feb 2006 18:42:22 -0800, "Marshall Spight"
> <marshall.spight_at_gmail.com> wrote:
>
> >Jon Heggland wrote:
> >
> >> What definition of 1NF do you use? I'm asking in earnest; there are
> >> quite a few different definitions floating around.
> >
> >I guess I use the definition that says 1NF means no
> >attributes of compound types. No list or set typed
> >attributes, that is. (Only conventionally we have to
> >pretend that varchar is not a compound type if we
> >want to use this definition, because, practically
> >speaking, you can't live without strings.)
>
> I don't agree with this. Strings are (IMHO) scalar types because they
> can be sorted. However, mathematical operations on them, except for
> comparison operators, are not possible. But there are other
> operations, such as concatenation and substring, which are.
>
> Also, the characters by themselves are meaningless much as the bits in
> a number by themselves are meaningless. It is the order of the bits,
> and the order of the characters, that give the number or string any
> meaning. Therefore, if you consider VARCHAR to be a compound type, you
> would have to say that DECIMAL is, too. And with real compound types
> such as lists or arrays, it is the elements themselves, and not the
> collection of elements, which gives the type semantic meaning.
>
> But I'm not a mathematician, so I couldn't say what it takes to prove
> whether something is a scalar type or not. Is there a formal
> definition?
>
> --
> Bob Hairgrove

Bob,

I'm not a mathematician, either, so bear with me.

I think the use of the term "scalar" here might be unfortunate, given the other uses that "scalar" has had over the years. In Pascal, the "Scalar types" and the "Simple Types" overlap, but not completely. Pointers and reals are simple types but not scalar types in Pascal.

Other people have used the term "atomic" in this newsgroup, but that term creates confusion as well. It implies that "substring" necessarily produces a meanignless result. But that's not true. If I create a database where telephone numbers
are sotred as strings of digits, and I build a substring function that pulls out the three digit exchange number, that three digit number could be meaningful for certain purposes (although it might have to be used in conjunction with an area code to avoid ambiguity).

Substring is not an operator that I would expect the relational layer of a DBMS to implement. But I would expect a different layer of the DBMS, one that deals with domain specific operations, to provide that service. SQL is a whole lot more useable if you have substring than if you don't. I'm speaking from experience.

The LIKE operator in Oracle is similar. Before LIKE was implemented in other DBMSes, there were a number of things you could only do programmatically in those systems, that you could, and should, fold into you SQL queries if you can use LIKE.

I prefer, "simple types" and "compound types" myself. But even "simple" can provoke multiple interpretation. Received on Wed Mar 01 2006 - 12:26:48 CET

Original text of this message