title: How to retrieve data from database table with condition in between date?
body: <p>I need to check the available hotels and quantity of rooms available on the hotels for some duration(start_date and end_date. </p>
  
  <p>I have a table test(id, date, qty, hotel_id). I need to access all the the hotel ids with some condition on qty (eg. qty>2) and date between two dates(for eg: the date field of the test table should have date value greater than the '2013-05-06' and end date less than '2013-05-10'). </p>
  
  <p>I tried this query: </p>
  
  <pre><code>select hotel_id
    from test
   where qty&gt;2
     and date between '2013-05-06' and '2013-05-10';
  </code></pre>
  
  <p>But, another condition is there must be all date between given dates. i.e. the date field should have all date date values: '2013-05-06', '2013-05-07', '2013-05-08', '2013-05-09', '2013-05-10' . If any of the above date is missing, then it should return empty resultset. And if all date are available with qty>2(let), then it should return list of hotel_ids.</p>
  
  <p>How can it be done in a single MySQL query?</p>