title: Count data for 15 minute intervals that are grouped by date
body: <p>I have the following MySQL table:</p>
  
  <pre><code>+---------------------+-----------+
  |      timestamp      | sensor_id |
  +---------------------+-----------+
  | 2010-04-09 01:42:31 |    M049   |
  | 2010-04-09 01:43:31 |    M049   |
  | 2010-04-09 01:44:31 |    M049   |
  | 2010-04-09 01:59:31 |    M049   |
  | 2010-04-10 01:10:31 |    M049   |
  | 2010-04-10 01:40:31 |    M049   |
  | 2010-04-10 01:42:31 |    M049   |
  | 2010-04-11 16:43:31 |    M049   |
  +---------------------+-----------+
  </code></pre>
  
  <p>I know how to query the db to get a count of the entries for a specific daytime intervall and group the result by date.</p>
  
  <p>An example to query the event count between 1 am and 2 pm would look like this: </p>
  
  <pre><code>SELECT
      date(timestamp) as date,
      count(timestamp) as count
  FROM 
      event_data
  WHERE 
      EXTRACT(HOUR FROM TIME(timestamp)) BETWEEN 1 AND 14
  GROUP BY 
      date
  </code></pre>
  
  <p>The query returns the following table:</p>
  
  <pre><code>+------------+-------+
  |    date    | count |
  +------------+-------+
  | 2010-04-09 |   4   |
  | 2010-04-10 |   3   |
  +------------+-------+
  </code></pre>
  
  <p>Now I only want to count an event every 15 minutes.
  The desired result would be:</p>
  
  <pre><code>+------------+-------+
  |    date    | count |
  +------------+-------+
  | 2010-04-09 |   2   |
  | 2010-04-10 |   2   |
  +------------+-------+
  </code></pre>
  
  <p>How do I alter my query to get these results?</p>