Databases Querying Relational Databases Joining Table Data with SQL JOIN Queries

Robbie Thomas
Robbie Thomas
31,092 Points

Challenge Task 2 of 5

I got the following code here

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

But it says: your query didn't select...

Am I worng or is there a bug in the system?

2 Answers

KRIS NIKOLAISEN
KRIS NIKOLAISEN
53,478 Points

You are close, but in your join with table Car you'll want to join the ModelID from table Car not the MakeID from table Make to Model.ModelID.

Robbie Thomas
Robbie Thomas
31,092 Points

Thank you for that. I did it with this:

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