Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: sql query?

Re: sql query?

From: Morten <morten_at_kikobu.com>
Date: Thu, 21 Feb 2002 03:07:54 +0100
Message-ID: <3C74567A.3020709@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 Wed Feb 20 2002 - 20:07:54 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US