Re: SQL (was: Why using "Group By")

From: Bob Badour <bbadour_at_golden.net>
Date: Thu, 13 Mar 2003 17:20:46 -0500
Message-ID: <NY7ca.4$GY2.112751_at_mantis.golden.net>


"Mikito Harakiri" <mikharakiri_at_ywho.com> wrote in message news:Do7ca.20$wV5.23_at_news.oracle.com...
> "Bob Badour" <bbadour_at_golden.net> wrote in message
> news:QP6ca.70$UR2.8484968_at_mantis.golden.net...
> > From what I have seen from them over the years, I expect them to screw
> > things up royally. They haven't disappointed me yet.
>
> Name a better languge.

D
Alpha
(Oops, that's two and the first one is an entire class of languages.)

> In SQL there is a "select" clause, it corresponds to projection operation

Actually, it is a combination of extend, project and summarize.

>, a
> "where" clause which combines all the predicates for restriction
operation,
> and "from" clause where Cartesian Product of all the tables/views resides.
A
> subquery can be plugged in into any of those parts. When we inline a
> subquery into the "from" clause, we leverage relational closure.

Table closure actually. Have you ever considered that SQL's cartesian product followed by restriction, if handled correctly, is a poor cousin of a relational join? Have you ever noted that it forces the effort to identify the common columns onto the user?

> Subquery
> into the "select" clause, as we saw, is a nice way to express aggregation.
> Chris Date considers scalar subqueries disgusting, but are they really?

Implicit conversion from a table to a scalar? Yeah, I agree they are disgusting.

> Does
> it mean that D4 won't allow subqueries in the select clause?

I don't know enough about D4 to express an opinion. I would be surprised if D4 has a construct that jumbles together so many logically distinct operations.

> Finally, a
> subquery in the "where" clause allows us to express logical quantifiers.
> This is as much SQL as I'm able to digest so far, but I wasn't
disappointed.

Without logical identity, the first question that comes to mind is: Logical quantifiers of what exactly? Received on Thu Mar 13 2003 - 23:20:46 CET

Original text of this message