title: SQL Average Calculation based on conditions of other columns
body: <p>How do I output the average for one column based on conditions from other columns? For example, this is what I did:</p>
  
  <pre><code>SELECT  
      AVG(TestScores WHERE ID = 1 AND Date_On BETWEEN '2017-04-08' AND '2017-04-12' AND Code = '87A')    
  FROM
      Table_Name
  </code></pre>
  
  <p>My desired goal is to obtain the average of the <code>TestScores</code> column when the <code>ID</code> of the <code>row = 1</code> and when the date falls between my specified interval. Is this possible? </p>