title: Create a table column as a sum of two columns in sql
body: <p>I have a table, and one of the columns is total_price, which stores the sum of prices of items which are stored in another table. I want to know how to do this in SQL. I want the total price column to calculate the sum of prices automatically and store in its column. In other words, I need a column which sums the required values and stores it by default.</p>
  
  <p>Example:</p>
  
  <p>Line item table has a quantity,pid and total price field.</p>
  
  <p>Product table has a pid and price field.</p>
  
  <p>The total price field in line item table should store (lineitem.quantity*product.price) value.</p>