MySQL Forums
Forum List  »  Newbie

Sakila giving some strange results
Posted by: Saleem Hasan
Date: April 06, 2015 09:01PM

Hello All,

I am very new to sql and mysql in particular. I installed the zip version of mysql on my windows machine and it works fine. I went through the first 3 chapters of the tutorial to test and to try out the menagerie database and everything worked fine. Then I got more amibitious and downloaded the zip version of Sakila and that is where some strange things have occurred. I am Only using the command line version of mysql to run sakila. I tried to use inner join on 2 or more tables and got strange results. They were not errors (syntax or others), just unexpected results.

So, I went back and started going through individual tables. I think the tables are messed up and the records that are being returned are somehow wrong.
Example 1
I decided to run simple queries in case I was making some mistakes in writing a more complex query. Using a simple query on the city table I found that there are two cities London (one in the UK and the other in Canada). I noted their city_id 312, 313. I then used the Address table with city_id and I got 2 records for the city_id 312. However, the District in the 2 records was different even though the city_id was 312 for London UK. In one, the district was England in the other, it was Ontario but, for the same city_id (312) which is London, UK.

Example 2
Another thing is that the address_id in the address table is unique to each address and so there are a large number of address_ids there. However, in the Store table, there are only 2 address_ids (1 and 2). As a result, it may not possible to join the Store table with the address table. Is that correct?

Example 3. The addresses, in terms of the names, do not match the names expected for that country. The 2 addresses given for London, UK (city_id 312) are
1497 Yuzhou Drive
548 Uruapan Street

My question:
1. Does it look like there is some problem with the zipped sakila tables.
2. Is there a reason that I cannot use sakila with a basic command line mysql instalation.

Thank you in advance for your help.

Saleem

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.