title: Percentages in MySQL - Between two columns in the same table
body: <p>I have a MySQL Table that looks like this:</p>
  
  <pre><code>Name    | Pass |  Fail | Pass Percent | Fail Percent
  
  Abdy    | 20   |  5    |              |
  Bob     | 10   |  5    |              |
  Cantona | 40   |  10   |              |
  Dave    | 30   |  20   |              |
  </code></pre>
  
  <p>I am trying to get the percentages:</p>
  
  <p>like : passpercent = (pass/pass+fail)*100</p>
  
  <p>Can I fill the table with a single MySQL code for both the columns??</p>
  
  <p>The Table would look like this hopefully:</p>
  
  <pre><code>Name    | Pass |  Fail | Pass Percent | Fail Percent
  
  Abdy    | 20   |  5    |   80         |  20
  Bob     | 10   |  5    |   66         |  33
  Cantona | 40   |  10   |   80         |  20
  Dave    | 30   |  20   |   60         |  40
  </code></pre>