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

Joining tables and Aliasing Code Challenge 1 of 2

I have run in to some sort of error, please let me know if it is user. My task is to join two columns, movies.title and genres.name, using an inner join, with titles being first. I have entered: SELECT movies.title, genres.name FROM movies INNER JOIN genres. This gets me the correct results, in the correct order in both workbench and the site-side engine. But the quiz says incorrect. Please Advise.

2 Answers

You're right but you need a little more. You've defined what will be shown and you've defined the inner join, but you haven't defined the relationship between the tables.

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

The "ON" operator starts the relationship, and you then use the format [table1].[column1] = [table2].[column2] to declare the relationship.

He talks about this in the video around the 1 minute mark. I hope this is helpful to you.

Ahhhh Thank you so much!