Abdelhadi Boukdir386 Points
My answer is correct but still showing error
select m.MakeName as MakeName, m.ModelName as ModelName, c.VIN as VIN, c.StickerPrice as StickerPrice from (select MakeName, ModelID, ModelName from Make as ma inner join Model as mo on ma.MakeID = mo.ModelID) as m inner join Car as c on m.ModelID = c.ModelID
Steven Parker182,438 Points
You're really close, but you're joining on dissimilar terms: "
ma.MakeID = mo.ModelID". Those should both be the same (MakeId).
Also, while this will work when fixed, you could simplify the query a good deal and still pass:
- you don't need a sub-query since JOINs can be chained
- you don't need any column aliases for the SELECT clause
- you don't need to qualify the columns with table aliases