Dave Smith wrote:
On Wed, 9 Nov 2005, Dave Smith wrote:
Can you confirm or deny this idea (that I heard many times):
most [if not all] of the "hairy SQL statements" in the assignments were
hairy only because of arbitrary constraints (e.g. not being allowed to use
"GROUP BY" or various other things that you'd use in "the real world" when
trying to find the same data).


For the earlier assignments, we couldn't use aggregate functions like SUM
and COUNT (I guess to give us an appreciation for them). For later
assignments, we were free to use whatever SQL tricks we wanted, including
aggregate functions.

Aggregate functions often force the database to perform a sequential scan, however. It sounds like it was valuable to learn different ways to get the same results, so that you'd be able to optimize queries in the real world.

Shane

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to