Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
217,519 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
217,519 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
217,519 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
217,519 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
217,519 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