title: trigger to update a Total_count column in one table by adding count/quantity in another table
body: <p>I created an inventory table with columns <code>product_id</code> and <code>total_count</code>.  When a purchase is entered in purchase table(<code>purchase_id</code>, <code>supplier_id</code>, <code>product_id</code>,<code>price, quantity</code>), it should update the total_count in inventory table.  The default value for total_count in inventory table is 0.</p>
  
  <p>for example when a purchase is made (supplier, charger ,price,25) it should update the inventory ( Charger, 25).</p>
  
  <p>I am not being able to do that. here's my code:</p>
  
  <pre><code>create or replace trigger trg_update_inventory 
  after insert on supplier_product 
  for each row 
  begin
      update inventory set total_count=total_count+ quantity where .....
  </code></pre>
  
  <p>I am stuck at this point. how do I make the trigger get the quantity from the purchase table and update the total balance?</p>