title: ORACLE - Calculate two values and show result in a view
body: <p>I received fantastic help from Dave Costa and Justin Cave <a href="https://stackoverflow.com/questions/8422652/trigger-to-calculate-subtotal">here</a> (thanks again) in how to calculate a subtotal value from two other attributes, Quantity and Price (so Quantity * Price = Subtotal). In one of the answers it was stated that from a normalisation point of view it's not good to do this as the subtotal value can be derived from the other two attributes and that I should probably look at using a View. I've read up on Views and am getting the concept (I'll be using them elsewhere regardless) but I'm still not sure how to go about actually calculating the two values and show the result in a custom view. If anyone could point me in the right direction I'd appreciate it.</p>
  
  <p>The current trigger (credit to Dave and Justin):</p>
  
  <pre><code>CREATE VIEW show_subtotal 
  AS SELECT price 
  FROM products
  WHERE product_no =:new.product_no;
  </code></pre>
  
  <p>:new.subtotal := currentPrice * :new.quantity;</p>