Re: Interesting article: In the Beginning: An RDBMS history

From: Christopher Browne <cbbrowne_at_acm.org>
Date: Sat, 08 Apr 2006 22:51:34 -0400
Message-ID: <87u093jwax.fsf_at_wolfe.cbbrowne.com>


Quoth "David Cressey" <dcressey_at_verizon.net>:
> "dawn" <dawnwolthuis_at_gmail.com> wrote in message
> news:1144419981.914579.164420_at_g10g2000cwb.googlegroups.com...
>> Yes, when doing set operations on an ordered set of attributes,
>> everything is handled as if the ordering were not there. So, the
>> ordering is irrelevant to SQL, but employed by other languages working
>> with the data. I don't know that it is ideal to have this, but it
>> doesn't seem to be a problem to model the stored data as actual
>> relations (with attributes ordered) either. --dawn
>
> SQL is by no means ideal when it comes to whether ordering is implicit in
> the language.
>
> Consider the following:
>
> INSERT INTO fubar (blech, zork, zonk)
> SELECT bimbo as zonk, jimbo as blech, zimbo as zork from xyzzy;
>
> Anyone would think that zonk would go into zonk, blech would go into blech,
> and zork would go into zork.
>
> Ahh but no! (At least not in the SQL diealects I am used to). The matchup
> is by position.
> The same for
>
> INSERT INTO fubar (blech, zork, zonk)
> VALUES ( 'A', 'B', 'C');
Well, this exposes that there are two quite independent ways that SQL allows imposition of ordering.

Firstly, there's:

   select c1 as cname1, c2 as cname2, ... cn as cnamen from some_relation;

This imposes a column ordering on a return set.

Secondly, there's

  insert into some_relation (c1, c2, ..., cn)

      values() or some consistently-ordered select

The independence of these impositions of order obviously lead to the "surprise."

I think you'd need a special further syntax in order to allow the ordering to become implicit.

It's not obvious to me that this is any sort of "anti-relational failing," either. If I specify orderings in two places, I think I'd be surprised to see the orders "magically" change.

> Anyone would think that zonk would go into zonk, blech would go into
> blech, and zork would go into zork.

I'm not sure what proportion of the population would fall into that "anyone"...

-- 
(reverse (concatenate 'string "moc.liamg" "_at_" "enworbbc"))
http://linuxdatabases.info/info/
"Computer science is like library science  -- you create a problem and
then study it." -- David Place
Received on Sun Apr 09 2006 - 04:51:34 CEST

Original text of this message