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 Database Foundations Joining Relational Data Between Tables in SQL Joining Tables and Aliasing

Travis Smith
Travis Smith
476 Points

LEFT OUTER JOIN Why would you want to do a LEFT OUTER JOIN versus just returning all of the data in the "Left" column?

Based on the example of the Venn Diagram I don't see why one would use the outer joins. If the left/right outer join returns all of the info in the left/right table why not just SELECT * FROM the left/right table why bother joining? What does the joining do here?

1 Answer

Joining shows data from multiple tables. An INNER JOIN shows ONLY records from each table where there is a match on whatever field(s) you are joining on. A LEFT JOIN or a RIGHT JOIN shows all the records from one table, and only those that have a match from the other. For one thing, they are very handy to see which records in one table (e.g., students) don't have a matching record in another table (e.g., parents).