Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fB3JDHm15497 for ; Mon, 3 Dec 2001 14:13:17 -0500 (EST) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.7) with HTTP id 519065; Mon, 03 Dec 2001 11:13:15 -0800 From: "Josh Berkus" Subject: Re: Need help with a college SQL exam question... To: dejauser2001@yahoo.co.uk (dejauser2001@yahoo.co.uk), pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.7 Date: Mon, 03 Dec 2001 11:13:15 -0800 Message-ID: In-Reply-To: <383ef96c.0111290754.4ab26b07@posting.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200112/29 X-Sequence-Number: 5852 "dejauser": > Its coming close to my January examinations, and > while revising I got stuck in the follwing question. > I literally spent hours trying to solve it but I > just can't :( hmmm ... I don't think it's according to the honor code to ask us to help with your exams. ;-) > And the question is; > Using SQL (using SELECT, FROM, WHERE, GROUP BY, COUNT(*), etc..) > write a query > to list the names of customers who have borrowed cars made by every > maker. It's doable. Just think "nested subselects" and heavy use of the HAVING clause. They're also screwing with you by providing an irrelevant table (shop) and not providing a relevant table (makers). If I was the professor, I'd give the question writer a D+ for database design ... -Josh ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco