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 trialLarry Singleton
18,946 PointsIt's a Database challenge question
Challenge Task 4 of 5
In a car database there is a Model table with columns, ModelID, MakeID and ModelName and a Car table with columns, CarID, ModelID, VIN, ModelYear and StickerPrice.
Show all Model names from the Model table along with VIN from the Car table. Make sure models that arenβt in the Car table still show in the results!
My last attempted code: > SELECT Model.ModelName from Model LEFT OUTER JOIN on Car.VIN = Model.ModelID, VIN;
Please don't tell me to watch the videos again, do provide "hints" or explain what I'm doing wrong, so I can figure it out. The code I have placed is one of a hundred versions, it's not the only attempt.
Thanks for any helpful input.
3 Answers
Konrad Traczyk
22,287 Points- You're missing table name between JOIN and ON keywords.
- I don't know why VIM column is at the end of your query, it should be after SELECT keyword.
- Also you have to put column ModelID from Car table instead of VIN column to your join expression(Car.VIN = Model.ModelID).
If you still having trouble see this page about SQL Joins.
Hope it helps.
Larry Singleton
18,946 PointsThank you for the direction. It's been a few hours since I've worked on the challenge question. I'm going back to try to tackle it now.
Larry Singleton
18,946 PointsI tried multiple variables before posting, in fact a couple of hours worth. After a while everything just became wild off the wall attempts. Thanks for the direction.