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

MySQL left and right join question

Hello, I don't quite understand left/right joining - wouldn't left joining just return the entire contents of one table, and right joining would return all contents of the other table? What am I missing here?

1 Answer

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

The outer joins return the data from one table + the data from another table that joins with the first. In the case of a left outer join, ALL the data from the first table listed in the query is returned with JUST the data from the second table that joins with the first table. If you watch this video again http://teamtreehouse.com/library/database-foundations/joining-relational-data-between-tables-in-sql/-joining-tables-and-aliasing it might make sense.

At the 2:40 mark in that video Andrew shows a diagram that I think makes the relationship clear.