title: Attempting a sample query in PostgreSQL, but the ROUND function isn't working properly? Issues with my syntax?
body: <p>I'm working through some online courses and am trying to run some practice queries on my own to calculate 'net sales to inventory' as a percentage in a sample table using the following syntax:</p>
  <pre><code>SELECT (ROUND((SUM(payment.amount)/SUM(replacement_cost))*100),2) 
    AS nsales2inventory_pct
  FROM film
  INNER JOIN inventory
  ON film.film_id = inventory.film_id
  INNER JOIN rental
  ON inventory.inventory_id = rental.inventory_id
  INNER JOIN payment
  ON rental.rental_id = payment.rental_id
  WHERE payment.amount &gt; 0.00;
  </code></pre>
  <p>I'm getting the correct result which is 21%, but am trying to drill down into a more precise number by using the ROUND function as shown in the SELECT statement above while adding the 2 decimal place requirement into the ROUND function changes the result from 21 in 'numeric' type to '21,2' in a 'record' data format, which I'm unfamiliar with. I'm sure I don't understand what I'm doing wrong because I'm not far enough along yet, but can someone explain to me how I have to adjust the ROUND function when including aggregate/mathematical operators within it?</p>