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 trialPablo Caro
4,191 PointsWhy is my between statement not working.
My code is not working. Can't get past this.
6 Answers
Pablo Caro
4,191 Pointshere is the code. very basic. I just want to confirm
select * from products
where price between 10.99 and 12.99;
here is the instruction In the e-commerce database we have the products table with the columns id, name, description and price. Find all the products in the database with the price including and between 10.99 and 12.99.
Jason Anello
Courses Plus Student 94,610 PointsThat seems to be right. If you want to link to the challenge I can check if it's passing for me.
chase singhofen
3,811 Pointsthe including messed me up even though i got it right on the 1st try i made myself go back and watch the video to make sure i didnt haveto type 'INCLUDING'
Ary de Oliveira
28,298 PointsChallenge Task 1 of 2
In the e-commerce database we have the products table with the columns id, name, description and price. Find all the products in the database with the price including and between 10.99 and 12.99.
SELECT * FROM products WHERE price BETWEEN 10.99 AND 12.99;
id name description price 1 Retro Gaming T-Shirt All your fave gaming characters on one t-shirt. 10.99 2 Generic Super Hero T-Shirt Your fave super hero is on this shirt. Wear it. 11.99
Roy Yap
17,968 PointsThis is the correct answer! SELECT * FROM products WHERE price <= 10.99 and 12.99;
Pablo Caro
4,191 Pointsso some context: I thought originally that we were using the >= <= but that did not work either. Thanks for the assist.
Pablo Caro
4,191 PointsI think it may just be an internal issue. It seems to be happening on just about most of my queries. I tried this one also and get results but i get message that I am missing a where clause. this missing where clause is a common theme. Below is the result of the query on the next step.
select * from products where name like '%t-shirt%';
id name description price 1 Retro Gaming T-Shirt All your fave gaming characters on one t-shirt. 10.99 2 Generic Super Hero T-Shirt Your fave super hero is on this shirt. Wear it. 11.99 3 Some Quirky Phrase T-Shirt Annoy your friends with this t-shirt. They'll seeing this phrase everytime you wear it. 9.99
Jason Anello
Courses Plus Student 94,610 PointsI tried both queries you posted in their respective challenges and they both passed fine for me.
Have you tried a different browser?
If the problem persists, I would contact treehouse support.
Ary de Oliveira
28,298 PointsSELECT * FROM products WHERE price BETWEEN 10.99 AND 12.99;
id name description price 1 Retro Gaming T-Shirt All your fave gaming characters on one t-shirt. 10.99 2 Generic Super Hero T-Shirt Your fave super hero is on this shirt. Wear it. 11.99
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsWhat statement are you trying and what challenge is this for?