title: How would I perform math within a sql query to calculate percent difference?
body: <p>I would like to take surveys (2 or more choices), and place the results in a table. I just want to know how I would tally up the results in a sql query.</p>
  
  <p>Even more, should i be doing the math within the query, or just use PHP to do the math?</p>
  
  <p><b>Example</b></p>
  
  <p><b>Questions Table</b></p>
  
  <pre><code>question_id (int)
  question (text)
  answer_1 (varchar)
  answer_2 (varchar)
  answer_3 (varchar)
  etc...
  </code></pre>
  
  <p><b>Answers Table</b></p>
  
  <pre><code>answer_id (int)
  question_id (int)
  answer (int) The answer they chose. (1, 2, 3, etc.)
  </code></pre>
  
  <p>How would/should I tally up the results?</p>
  
  <p><b>Edit: </b> using MySQL, PHP. The difference between the answers (45% said blah, 50% said blah blah, 5% said bloch). Not for homework, Im EE, not CS</p>