displaying results from different tables mysql
ive been trying to work this out for the last hour. my college tutor give me this question and i cant figure out what to do.
the question is
Show all Counties in the UK where one direction has performed
this is the db and tables:
CITY (Name, County, Country)
THEATRE (Name, City, County, Capacity)
SHOW (Title, Artist, Venue, Attendance)
This is my answer:
SELECT country from theatre
INNER JOIN show
ON theatre.name = show.venue
WHERE artist = 'one direction'
AND county=(
SELECT country FROM theatre
INNER JOIN city
ON theatre.city = city.name
WHERE city.country = 'UK'
)
am i close?
ive been trying to work this out for the last hour. my college tutor give me this question and i cant figure out what to do.
the question is
Show all Counties in the UK where one direction has performed
this is the db and tables:
CITY (Name, County, Country)
THEATRE (Name, City, County, Capacity)
SHOW (Title, Artist, Venue, Attendance)
This is my answer:
SELECT country from theatre
INNER JOIN show
ON theatre.name = show.venue
WHERE artist = 'one direction'
AND county=(
SELECT country FROM theatre
INNER JOIN city
ON theatre.city = city.name
WHERE city.country = 'UK'
)
am i close?
No comments:
Post a Comment