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 trialClaire Brehm
9,098 PointsTask 1 challenge help
The question: 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.
Use a subquery along with IN to list all the Model Names with a Sticker Price greater than $30000
My code: SELECT modelid FROM model WHERE modelid IN (SELECT stickerprice FROM car WHERE stickerprice > 30000)
Thanks!
2 Answers
KRIS NIKOLAISEN
54,971 PointsSince modelid IN
is trying to match modelid's your subquery should be retrieving modelid's.
Stevan Krkelic
3,278 PointsI'm doing this today, gonna leave my code here to help out next person that encounters issues with this one.
SELECT modelname FROM model WHERE modelid IN (SELECT modelid FROM car WHERE stickerprice > 30000);
Aleksandra Klipa
1,628 PointsAleksandra Klipa
1,628 PointsHi Clair,
Thank you for addressing this matter.
Did you manage to fins the correct answer for this one?
Thanks a million.
-Aleksandra Klipa