title: SQL how many items of certain level are correct (query issue)?
body: <p>To make a big sql structure simple: I am having next structure:</p>
  
  <pre><code>id    level    answercorrect    points
  1     1        0                0
  2     1        1                60
  3     1        1                80
  4     1        1                77
  5     1        1                92
  6     1        0                0
  7     2        0                0
  8     2        0                0
  9     2        0                0
  10    2        1                80
  11    2        0                0
  12    2        0                0
  </code></pre>
  
  <p>I now want to display two things: </p>
  
  <p><strong>1)</strong> how many levels were completed (this is min. half of the questions correct)</p>
  
  <p><strong>2)</strong> the level where you scored the most points. </p>
  
  <p>Now I can go and manually do a query for each level, then compare them and then output them. </p>
  
  <pre><code>SELECT (*) FROM QUESTIONS WHERE LEVEL = level AND ANSWERCORRECT = 1
  </code></pre>
  
  <p>But Is there a way to do this quicker? It just seems like a to big bunch of code to accomplish that on my way..?</p>