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 trialmichaellacy
1,335 PointsOutter Join
Can someone look at my code and give me a little direction?
Like before, bring back the movie 'title' and genre 'name' but use the correct OUTER JOIN to bring back all movies, regardless of whether the 'genre_id' is set or not.
Code:
SELECT movies.title, genres.name FROM movies FULL OUTER JOIN genres ON movies.genre_id = genres.id;
1 Answer
Kyle Robertson
31,600 PointsI'm still pretty new at this, but I think a LEFT OUTER JOIN would work, as it would contain all the movie titles even if there wasn't a genre_id associated with every one of them.