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 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).