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

Use an INNER JOIN to join the 'movies' and 'genres' tables together only selecting the movie 'title' first and the genre

hi guys i been stack in this challenge can someone guys help me to answer this one i use command statement like this SELECT movies.title, genres.name FROM movies INNER JOIN genres to retrieve the movies title and genres name but its give me an error this challenge has two table name movies with the column of title and genres with the column of name it should only selecting movie title first and second genre name

3 Answers

Hi Liad thanks for reply yeh i got the answer i just confuse about the question i just trying to just join the table and retrieve the table column it self joining table is looking for foreign key and primary key

Liad Idan
.a{fill-rule:evenodd;}techdegree seal-36
Liad Idan
Full Stack JavaScript Techdegree Graduate 20,279 Points

Yes you're right, I also think that some of the questions aren't well-phrased... they had to mention that you need to retrieve only the movies with genre assigned to them.

There's might be an error in the system, I wrote the following statement several times but it always returns an error:

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

Is there anyone can help to solved it.

Thanks Pietro