title: SQL SUM and Average Sale by Years
body: <p>I have a table where monthly sales are recorded. See image for a sample of the table.<a href="https://i.stack.imgur.com/HI7oA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HI7oA.jpg" alt="enter image description here"></a></p>
  
  <p>So this data is partial, I have months 1-12 for every year since 2000. What I would normally do is query total sales for any one year like this:</p>
  
  <pre><code>SELECT SUM(total_sales) as TotalSalesYear FROM sales_report WHERE year =  '2008'
  </code></pre>
  
  <p>What I want to do here is determine the highest year in sales and the average sales per year since 2000. So I need to do a SUM per year, and determine which year is the highest. Then, once I have the SUM for each year, I can come with an average of sales per year. </p>
  
  <p>I'm just not sure how to query this.</p>
  
  <p>Thank you.</p>