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 Querying Relational Databases Joining Table Data with SQL JOIN Queries

David Corrales
David Corrales
4,698 Points

This one seems so puzzling! I have already inserted 2 INNER JOINS, what else?!

Challenge Task 2 of 5 In a car database there is a Make table with columns, MakeID and MakeName, a Model table with columns, ModelID, MakeID and ModelName and a Car table with columns, CarID, ModelID, VIN, ModelYear and StickerPrice.

For all cars in the database, show Make Name, Model Name, VIN and Sticker Price from the Model and Car tables in one result set.

Type in your command below, then press Ctrl-Enter.

Bummer: You need to join 3 tables, you need to use two INNER JOINs

SELECT mk.MakeName, md.ModelName, ca.VIN, ca.StickerPrice FROM Make AS mk INNER JOIN Model AS md INNER JOIN Car as ca ON mk.MakeID = md.MakelID = ca.CarID;