title: calculate daily average sale from sql table
body: <p>I want to calculate the daily average of sales from my sql table .
  I tried using the following query but it gives error saying "Incorrect syntax near keyword select"</p>
  
  <pre><code>select avg(select sum(total) from canteen group by date) as average from canteen
  </code></pre>