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

Juan Juarez
Juan Juarez
2,292 Points

Not sure how to set up Task 2 of 5 on querying relational databases, not sure if multi table join is correct?

I got something back trying this, I know its wrong can't figure out why

SELECT MakeName, ModelName, VIN, StickerPrice FROM make INNER JOIN Model ON make.MakeID = Model.MakeID INNER JOIN Car ON make.MakeID = Car.ModelID;

1 Answer

Patrik Horváth
Patrik Horváth
11,110 Points

okey 1st witch chalange ? any link to it ?

i try fix it without it

1st :

if you USE JOIN you should specify with TABLE you selecting info why? because there can be multiple same name coloms in 1st and 2nd table for example

your :

MakeName, ModelName, VIN, StickerPrice

Fixed (just example because idk question info):

make.MakeName, Model.ModelName, Mode.VIN, Car.StickerPrice

2nd: Are you sure you dont need to use "AS" ?

3rd : are you sure with this ?, because MakeID and ModelID is diffrent and i dont think they chaosed diffrend collum names :

make.MakeID = Car.ModelID;