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:
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.
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.
Chinedum Igbonagwam411 Points
SELECT id, name, description, price FROM products WHERE price <= 10.99;