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

SQL Error: no such column: VIN

I am on task 1 of 5 for the relational database challenges and I don't understand this error. the prompt specifically lists VIN as a column but is telling me that there is no such column?

Select md.modelname,VIN,ca.stickerprice from Model Inner Join Model md ON md.modelid=ca.modelid;

1 Answer

Travis Alstrand
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Treehouse Project Reviewer

Hey zaal rottunda !

Currently, you're SELECTING FROM and JOINING ON the same table, and since VIN is on the Car table, it's not understanding where to find it. If you're selecting from Model, be sure to INNER JOIN the Car table, or vice versa :smiley:

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