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 Reporting with SQL Aggregate and Numeric Functions Performing Math

I am way off .. help

SELECT price WHERE price = ROUND(1.4 / 1) GROUP BY "price.gbp" FROM products;

6 Answers

Steven Parker
Steven Parker
231,268 Points

Here's a few hints:

  • the instructions say to return "the product name and price..." but the name is missing here
  • they also say "Alias the calculated price to price_gbp." (with an underscore instead of a period)
  • you won't need a WHERE clause since you will be returning all rows
  • you also won't need a GROUP BY
  • recheck the syntax for using the ROUND function

Extra hint: there's an example of a very similar task at the end of the previous video.

SELECT name, ROUND(price 1.4/1, 2) AS "price_gbp"; still did not get it trying to make sense.

Steven Parker
Steven Parker
231,268 Points

The first term in the ROUND should be a valid math expression, and "price 1.4/1" isn't quite right.

thanks

SELECT price FROM products WHERE price = ROUND(1.25/1) GROUP BY price_gbp;

still off what piece am i missing.

Steven Parker
Steven Parker
231,268 Points

Most of the original hints still need to be applied. And where did the number "1.25" come from?

still wrong uggg

SELECT name FROM products, price = ROUND(1.4 / 1,2) as "price_gbp";

Steven Parker
Steven Parker
231,268 Points

Functions and aliases belong in the SELECT clause (as explained in your other question). The function syntax itself needs a bit of work, take another look at the example near the end of the last video.

SELECT name, ROUND(price / 1,2) as "price_gdp" FROM products;

still wrong

Steven Parker
Steven Parker
231,268 Points

Really close now, just 2 issues left:

  • the exchange rate given in the instructions is 1.4 instead of 1
  • the instructions ask for an alias of "price_gbp" instead of "price_gdp"

i got it now thanks agian