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

donald kaiser
donald kaiser
9,736 Points

It's saying that I'm missing the division operator but why in God's name would I need that?

This is super confusing. I'm not understanding how to convert mathematically from one currency to another using division.

Steven Parker
Steven Parker
231,271 Points

To make it possible to analyze your issue and give an answer, please show your code (formatted using Markdown) or make a snapshot of your workspace and post the link to it here.

Also please provide a link to the course page you are working with.

2 Answers

Steven Parker
Steven Parker
231,271 Points

Here's a generic example.

Without seeing the code, I can only give a generic example. Let's say you were converting dollars to pounds, and every pound was worth 2 dollars. Wouldn't it make sense to use the division operator to divide the dollars by 2?

donald kaiser
donald kaiser
9,736 Points

Sorry about that Steven. Here is the link. https://teamtreehouse.com/library/reporting-with-sql/aggregate-and-numeric-functions/performing-math

I didn't think I needed the division operator because if I had $1 then I'd multiply to know the price in pounds since pounds is worth more. I just tried this code and it's correct. I got a bit confused by the currency exchange.

SELECT name, ROUND(price / 1.4,2) AS "price_gbp" FROM products;

Steven Parker
Steven Parker
231,271 Points

So you did find a use for the division operator after all. :wink:

Congratulations on resolving your issue. :+1: And happy coding!