Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

I am having problems with joining tables and aliasing, challenge 1

I am having problems with joining tables and aliasing, challenge 1.

I am confident I have the right answer and I've even used the three different formats shown to me on the MYSQL 5.0 manual, but I keep getting an error and its telling me this...

You're not retrieving the movie 'title' first and the genre 'name' second. Use an INNER JOIN. I am having problems with joining tables and aliasing, challenge 1.

I am confident I have the right answer and I've even used the three different formats shown to me on the MYSQL 5.0 manual, but I keep getting an error and its telling me this...

You're not retrieving the movie 'title' first and the genre 'name' second. Use an INNER JOIN.

here is a copy of the answer I put in.

SELECT movies.title, genres.name FROM movies INNER JOIN genres ON movies.title = genres.name;

PLEASE HELP ME...

here is a copy of the answer I put in.

SELECT movies.title, genres.name FROM movies INNER JOIN genres ON movies.title = genres.name;

PLEASE HELP ME...

3 Answers

Looks like you're trying to relate the data using the movie title and genre name but those two columns aren't likely to have records that are ever equal to each other. What you want to do instead is join the two tables when the genre ids are equal.

Try this!

SELECT movies.title, genres.name FROM movies INNER JOIN genres ON movies.genre_id = genres.id;
Oriyomi Alimi
Oriyomi Alimi
2,305 Points

Hi Katie,

I am actually putting that exact code syntax in and still getting the same error as the OP.
"SELECT movies.title, genres.name FROM movies INNER JOIN genres ON movies.genre_id = genre.id; "

What am I missing?

Hi there!

I've just tried out Katie's answer, and it works perfectly for me. Have you tried refreshing the page or clearing your history? I know that sometimes Challenges will refuse to accept an answer that's correct, but refreshing the page almost always fixes that for me.

Jonathon Mohon
Jonathon Mohon
3,165 Points

I had the exact same code as Katie and it tells me that its wrong. Says "you're not retrieving the movie 'title' first and the genre 'name' second. Use INNER JOIN."