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

Inner Join

I haven't worked on this material in a week or two, so everything is coming back rusty. I'm trying to do the INNER JOIN, but the hint suggests something I don't have in my notes:

"You're not fully qualifying the join e.g. table1.primary_key_id = table2.foreign_key_id"

I believe my code should be attached to the post.

Steven Parker
Steven Parker
229,644 Points

Edit the question and add your code to it manually.

2 Answers

Steven Parker
Steven Parker
229,644 Points

Both VIN and StickerPrice are requested in the result set and should be part of the SELECT clause

The error message is trying to remind you that the ON clause needs to show which column of each table to use for joining, each qualified with the table name. Since the only column these tables have in common is ModelID, the ON expression should be Model.ModelID = Car.ModelID.

SELECT ModelName FROM Model INNER JOIN Car ON VIN, StickerPrice;

That's the query I've been using, but can't figure out what the equality criteria should be after the ON keyword....