title: mysql query for average bookings per month
body: <p>I am working on a query to give me a view of customer habits, eg - average spend, number of bookings etc.</p>
  
  <p>my current query looks like</p>
  
  <pre><code>SELECT email, 
     Avg(amount_paid) AS avg_paid, 
     Count(*)         AS no_times_booked 
  FROM   bookings
  GROUP  BY email  
  </code></pre>
  
  <p>This gives me the email, average spend and number of times booked</p>
  
  <p>my table looks like</p>
  
  <pre><code>email           | amount_paid | booking_date
  email@email.com | 50.00       | 2010-01-13
  email@email.com | 50.00       | 2010-01-13
  email@email.com | 50.00       | 2010-01-13
  </code></pre>
  
  <p>How do I adjust my query to give me the average number of bookings per month?</p>
  
  <p>so my results would look like the below, ultimately I am after one average number per user - if they only book once the following month their average would come down.</p>
  
  <p>Or to put it another way, I am trying to label regular customers - one booking per month or above would be regular.</p>
  
  <pre><code>email           | avg_spend | number_bookings | avg_bookings_per_month
  email@email.com | 50.00     | 3               | 3  
  </code></pre>