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

Databases

Why does this code work in SQL?

Select Model.ModelName, Car.VIN from Model left outer join Car on Car.Modelid = Model.ModelID left outer join Make on Model.MakeID = Make.MakeID;

This code works but I am wondering if anyone can explain why it works and where does the Make come into this

Here is a link to the question: https://teamtreehouse.com/library/querying-relational-databases/joining-table-data-with-sql/join-queries

It is challenge 4.

1 Answer

Steven Parker
Steven Parker
231,236 Points

Most likely, the database used to test the tasks is the same, even if some questions don't need all of the tables.

Clearly this question could have been answered with a single join, but the extra one did not affect the output so it still passed the challenge.