title: Trying to use ORDER BY with average values
body: <p>I need to sort values from an SQL table according to the averages of certain values.</p>
  
  <p>My 'Exams' table looks like this:</p>
  
  <pre><code>+------------+------------+------+
  | Exam       | Student_ID |Points|
  +------------+------------+-------
  | Math       |     3      | 20   |      
  |Accounts I  |    23      | NULL | 
  |Statistics  |    12      | 15   |
  |Accounts II |     3      | 21   |
  +------------+------------+------+
  </code></pre>
  
  <p>Here's the query I've attempted:</p>
  
  <pre><code>SELECT Student_ID FROM Exams GROUP BY Student_ID ORDER BY avg(POINTS) desc
  </code></pre>
  
  <p>My aim is to get the student ID of the student with the highest average rating, in this case, 3</p>
  
  <p>Is my approach correct, or is there an error lurking in there? How will I be able to handle NULL values in the Points column?</p>