title: Create table which hold columns of another table and count values of another table
body: <p>I have table temp:</p>
  
  <pre><code>id  sentence pcount ncount
  1      -       3      5   
  2      -       2      6
  3      -       1      5
  4      -       7      2
  </code></pre>
  
  <p>.....</p>
  
  <p>I want to create table from above existing table which should get update when above table changes</p>
  
  <pre><code>New_temp
  
  ind_type     Index_val
  pcount         sum(pcount)
  ncount         sum(ncount)
  </code></pre>
  
  <p>Is it possible? 
  please tell me how this could be done.</p>