| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: sql query?
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
![]() |
![]() |