title: MySQL command to substract two values from two different tables using MySQL
body: <pre><code>TABLE NAME::NEWSALES
  --------------------------------------------                                                          
  NID |BRAND  | QUANTITY |   PRICE  |  TOTAL |
  ---------------------------------------------
  1  | D&amp;G    |   50     |  2250.0  | 112500 |        
  2  | GUCCI  |   40     |  2150.5  |  86020 |
  ---------------------------------------------
  </code></pre>
  
  <p>TABLE::SOLDOUT</p>
  
  <pre><code>-----------------------------------------------------------------
  SID |BRAND|   SOLD     |  PRICE |   TOTAL | REMAINING QUANTITY |
  -----------------------------------------------------------------
  10  | D&amp;G   | 20     |   900  |   180000 |     ?               |
  11  | GUCCI |  10    |   5375 |    53750 |     ?               |
   -----------------------------------------------------
  </code></pre>
  
  <p>//I need to subtract QUANTITY-SOLD=REMAINING QUANTITY
  // example :: If we consider 'quantity' as 50 from NEWSALES table AND 'sold' as 20 from SOLDOUT table
   then it should give '50-20=30'(REMAINING QUANTITY)</p>