title: Sql query to fetch the number of visitors per day since the last 7 days only
body: <p>I have a database table <code>visitors</code> with three columns:</p>
  
  <pre><code>id | Name | checkin_date               |
  1  | Reg  | 2018-04-20T08:28:54.446Z   |
  2  | Meg  | 2018-04-21T08:28:54.446Z   |
  3  | Ted  | 2018-04-21T08:28:54.446Z   |
  4  | Bin  | 2018-04-23T08:28:54.446Z   |
  </code></pre>
  
  <p>There are several records such as these. 
  I want to fetch the count of records per each day for only the past 7 days. Right now i was able to fetch the count of visitors per day for all the dates using :</p>
  
  <pre><code>select count(id) as no_of_users
       , DATE_FORMAT(checkin_date, '%d %b, %Y') as date  
    from visitors  
   GROUP 
      BY DATE(checkin_date)
  </code></pre>
  
  <p>But this displays the count of users per each day of all the records. How to get the records of only past 7 days.</p>