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

olu adesina
olu adesina
23,007 Points

where im i going wrong SQL

I belive i am using the round() function correctly in this question but its my math which is not up to scratch please help

Challenge Task 1 of 1

In an ecommerce database we have a products table with the columns id, name, category, description, price and stock_count.

The price is in USD. Write a query that returns the product name and price in Pounds Sterling (GBP). The current exchange rate is 1.4 USD to every 1 GBP. Alias the calculated price to price_gbp. Round to two decimal places.

SELECT ROUND(price/1.4*1, 2) AS price_gbp FROM products;    

1 Answer

Steven Parker
Steven Parker
231,236 Points

The instructions ask for a "query that returns the product name and price ...", but the query shown here returns only the price.

Also, you won't need to multiply anything by 1 — that won't have any effect on the value.

In future questions, for the most accurate answers always provide a link the the course page.