Re: sql query?

From: Morten <morten_at_kikobu.com>
Date: Thu, 21 Feb 2002 03:07:54 +0100
Message-ID: <3C74567A.3020709_at_kikobu.com>


D'laila Pereira wrote:
> Given the following tables
> tourist(tid,tname)
> travel(tid,city, arrivaldate,stayindays)
>
> find, the names of the tourists who have visited "Detroit" and "Miami" but
> no other cities.
>
> Any hints on how to solve this one?

Make a join on the tourist and travel tables on the tid key (I assume that travel.tid references tourist.tid).

Google: sql tutorial join

Take your time and read a tutorial, using joins is straightforward and *very* useful.

Once you've made the appropriate join, you can add extra predicates to your query, like travel.city = 'Miami' fex.

Morten Received on Thu Feb 21 2002 - 03:07:54 CET

Original text of this message