Re: Sakila giving some strange results
Barry,
Thank you very much for taking a look at my queries.
Saleem
1. select city_id, city, country from city inner join country on city.country_id = country.country_id where city = 'london';
Returned 2 records
313 London Canada
312 London United Kingdom
2. Also ran a simpler query
select city_id, city from city where city = 'london';
Returned 2 records
312 London
313 London
3. select city.city_id, city, address.address, address.district from city inner join address on
city.city_id = address.city_id where city = 'london';
Returned 2 records
312 London 1497 Yuzhou Drive England
312 London 548 Uruapan Street Ontario
4. To query 3, I added an inner join with table Country and added country in select
select city.city_id, city, address.address, address.district, country from city inner join address on
city.city_id = address.city_id inner join country.country_id = city.country_id where city = 'london';
312 London 1497 Yuzhou Drive England United Kingdom
312 London 548 Uruapan Street Ontario United Kingdom