Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools

Nancy Melucci
seal-mask
.a{fill-rule:evenodd;}techdegree
Nancy Melucci
Front End Web Development Techdegree Student 34,543 Points

The code I am using for the challenge (addendum to my previous message about the code challenge for Joining Tables/alias

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

this is what I used for my response and then I get the error message from the code challenge that I need to "put movies first"....But I don't know how to do that other than putting the word FIRST in...and this is not demonstrated in the video??

2 Answers

You need show only two fields. First - movie "title" Second - genre "name"

You need join movies and genres tables, on the fields movie "genre_id" and genres "id"

Alex Kenny
Alex Kenny
7,761 Points

Hi Nancy,

I'm not sure I understand the error message you've described in your post but let me try and help you solve the problem anyway.

First you need to select movies.title and genres.name instead of * (which means everything, all columns from your table) in your select statement.

You're almost right with your INNER JOIN but to make it clear, you'll notice the movies table has a column movies.genre_id and the genres table has a column genres.id. These two columns are equal as in they both refer to the same value so it would be the common factor you would join the two tables with. The movies table uses the genre_id to link the movie to the particular genre. So you'll need to make your join look something like this: INNER JOIN genres ON movies.genre_id = genres.id. You can see this in the code snippet I've made for you below.

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

Hope that helps. Good luck!