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

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!