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 trialRamon Carvalho
2,910 PointsCan't see where the code is wrong
Hi everyone!
I can't see where the code below is wrong. Need some help.
SELECT id, name, description, price FROM products WHERE price IN (7.99, 9.99, 11.99);
Thanks!
Ramon Carvalho
2,910 PointsHi Sergey,
The task question is:
"We have an e-commerce database. Inside the products table we have the columns of id, name, description and price. Without using the OR keyword, find all products with the price of 7.99, 9.99 or 11.99."
7 Answers
bothxp
16,510 PointsHi Ramon,
So you are trying Task 1 of 2, searching-within-a-set-of-values
"We have an e-commerce database. Inside the products table we have the columns of id, name, description and price. Without using the OR keyword, find all products with the price of 7.99, 9.99 or 11.99."
Your answer was bringing back the correct results, but you hadn't written it the way they wanted you to. It asks you to 'find all products' so it is expecting you to use * instead of listing out the 4 columns. So try:
SELECT * FROM products WHERE price IN (7.99, 9.99, 11.99);
Ramon Carvalho
2,910 PointsThank you!! I wasn't thinking about that possibility!
chase singhofen
3,811 Pointsi did this and it marked it wrong it asked if i used the products table. but then i retyped it and it marked it correct so idk.
Ary de Oliveira
28,298 PointsSELECT * FROM products WHERE price IN (7.99, 9.99, 11.99); WORKS COOL..
Nasir Atta
2,177 Pointsselect * from products where price != 9.99;
Setfree Shonhai
4,292 PointsSELECT * FROM products WHERE price != "9.99";
Jamal Shiekh
6,440 PointsSELECT * FROM products WHERE price IN (7.99, 9.99, 11.99);
Tawanda Kaseke
11,202 PointsSELECT * FROM products WHERE price IN (7.99,9.99,11.99);
christopherabosi
7,291 PointsSELECT id, name, description, FROM products WHERE price IN (7.99, 9.99, 11.99);
Ramon Carvalho
2,910 PointsHi Cristopher,
Unfortunately it didn't work =/
Oluseyi Anani
2,125 PointsSELECT * FROM products WHERE price IN (7.99, 9.99, 11.99);
Sergey Podgornyy
20,660 PointsSergey Podgornyy
20,660 PointsRamon, can you post a task question, please? It looks like your code is correct.