Tables:
PERSON
(ssn, Name)Has_Visited
(ssn, city)Belongs_To
(City, country)
Based on following information, create this question:
What is the name of the persons that have visited the city "London"?
Tables:
PERSON
(ssn, Name)Has_Visited
(ssn, city)Belongs_To
(City, country)Based on following information, create this question:
What is the name of the persons that have visited the city "London"?
Select p.Name from person p,has_visited hs
where p.ssn= hs.ssn and hs.city= 'LONDON'
Just use the in
operator:
SELECT name
FROM person
WHERE ssn IN (SELECT ssn
FROM has_visited
WHERE city = 'London');