|
Posted by Erland Sommarskog on 04/17/07 21:37
(tizmagik@gmail.com) writes:
> I am fairly new to SQL programming and believe me that wasn't the only
> thing that the assignment asked, however this question was the one
> question that I had a lot of trouble with and the lack of a book for
> the class (it's strictly lecture notes) was what brought me to look
> for help elsewhere.
>
> If I would have based the SQL query on the examples given by the
> professor I would have gotten a list of all customers who bought *at
> least one* item that "john" prefers, as apposed to the correct list
> (all customers who bought *all* the items that john prefers).
> Furthermore, the professor did not go over COUNT so I really did not
> see any way of doing it with what he has gone over so far. Perhaps
> there is a solution without using COUNT, I will be sure to ask the
> professor during next lecture.
So that's another problem with asking for help with class assignments
on Usenet. While the COUNT may be a more elegant solution, the professor
probably wanted you to exercise in the use of EXISTS and NOT EXISTS.
Which certainly is an investment worth making, because such problem
as commonplace. (While the exercise you had, has a disctinct flavoour
of class assignment. Did I ever encounter such a problem myself? I can't
recall any.)
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|