title: how to populate mysql column value based on a formula?
body: <p>I have created a mysql table with the following columns...</p>
  
  <pre><code>item_price, discount, delivery_charge, grand_total
  </code></pre>
  
  <p>The value of <code>item_price</code>, <code>discount</code>, and <code>delivery_charge</code> all vary depending on the item under consideration, and these would be filled into the table manually.</p>
  
  <p>I would like to have mysql populate the value in the <code>grand_total</code> column based on the values of <code>item_price</code>, <code>discount</code>, and <code>delivery_charge</code>, using the formula below...</p>
  
  <pre><code>grand_total = item_price - discount + delivery_charge
  </code></pre>
  
  <p>Can I somehow specify a formula for this column while creating the table structure in mysql? I know this can be done using php, but I prefer the database doing this for me automatically, if possible.</p>