title: Calculate percentage SQL
body: <p>I have a database with products and the client need to enter a discount percentage.
  The discount must be calculatet in the database so the query returns all prices - discount</p>
  
  <p>How can i do that?</p>
  
  <pre><code>SELECT product.name sizes.height, sizes.width, product_sizes.price 
  FROM   product_sizes as s 
  JOIN   sizes ON s.sizeid = sizes.sizeid, product 
  JOIN   product_sizes on product.productid = product_sizes.productid 
  WHERE  product.productid=1
  </code></pre>
  
  <p>Thanks</p>