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 trialTadjiev Codes
9,626 PointsIn a car database there is a Model table with columns, ModelID, MakeID and ModelName and a Car table with columns, CarID
In a car database there is 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 Model Name, VIN and Sticker Price in one result set.
Kind of stuck with this as don't understand which foreign key should be connected through inner join?
3 Answers
Mark Sebeck
Treehouse Moderator 37,905 PointsYou need to join on ModelId
Tadjiev Codes
9,626 PointsSELECT modelname, vin, stickerprice
FROM model AS m INNER JOIN car AS c
ON m.modelid = c.modelid;
Alright this seems to work
Mark Sebeck
Treehouse Moderator 37,905 PointsAwesome! Glad you were able to solve with just a little hint.
Tadjiev Codes
9,626 PointsThank you)))