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 SQL Basics Finding the Data You Want Filtering by Comparing Values

Discovered bug in Filtering by comparing columns Challenge Task

I discovered a bug when completing Filtering by comparing columns Challenge Task because the back end database executes my query just fine, but the web interface produces an error saying that: "Bummer! You didn't select all columns." Basically, there's more than 1 way to solve this challenge problem set, but the front end doesn't acknowledge listing columns vs. using the asterisks. A specific problem from that challenge task:

We're back using the e-commerce database. I only have 10.99 left in my bank account. Write a query that will return all products from the products table that I can afford. The columns in the products are id, name, description and price.

My query was:

SELECT name, description FROM products WHERE price (is less than or equal to) 10.99;

Note: I couldn't write the symbols of less than or equal to without it disappearing

It did display the result that we're looking for but the front end wouldn't accept this query answer to the problem: name description Retro Gaming T-Shirt All your fave gaming characters on one t-shirt. Some Quirky Phrase T-Shirt Annoy your friends with this t-shirt. They'll seeing this phrase
everytime you wear it.

Steven Parker
Steven Parker
231,268 Points

:point_right: to write <= so it can be seen here, you actually write: &lt;=

Something is wrong with the markdown formatting.

We used to be able to post inline code with single backticks and not have to worry about html entities.

Steven Parker
Steven Parker
231,268 Points

It looks like <it got fixed>. :ok_hand: Maybe a side effect of closing the security hole I discovered. :smile:

Glad to see that because I think there was a lot of existing answers with stripped out inline html that no longer made much sense.

2 Answers

Hi abbymann,

The code challenge wants all the columns returned in the results. This is what the error message is indicating. You're only selecting the name and description columns but the table also has an id and price column.

Your query returns the correct products but only 2 out of the 4 columns.

The challenge will accept you listing out individual columns but you have to list them all out. It ends up being easier then to use the * to select all columns. Either one will pass though.

Josh Bennett
Josh Bennett
15,258 Points

I've all 4 columns in mine but it still says that I haven't selected all columns.

SELECT id, name, description, price FROM products WHERE price < 10.99;

The error says "Bummer! You didn't select all columns." Even though I did.

Though when I typed

SELECT id, name, description, price FROM products WHERE price <= 10.99;

It was correct.

The error message I received didn't match the error in the code.

Chinedum Igbonagwam
Chinedum Igbonagwam
412 Points

SELECT id, name, description, price FROM products WHERE price <= 10.99;