title: SQL request to find if a period is fully covered
body: <p>I have a set of periods like:</p>
  
  <pre><code>CREATE TABLE `periods` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `start_at` date DEFAULT NULL,
    `end_at` date DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  LOCK TABLES `periods` WRITE;
  
  INSERT INTO `periods` (`id`, `start_at`, `end_at`)
  VALUES
      (1,'2013-04-29','2013-04-30'),
      (2,'2013-05-05','2013-05-10'),
      (3,'2013-05-10','2013-05-15'),
      (4,'2013-05-15','2013-05-16'),
      (5,'2013-05-18','2013-05-19'),
      (6,'2013-05-19','2013-05-25');
  
  UNLOCK TABLES;
  </code></pre>
  
  <p>My intended desire, is the most optimized way to know if a given period is fully covered by one or multiple periods.</p>
  
  <p>For instance:</p>
  
  <p>1) to get <code>null</code> for a request from <code>2013-04-29</code> until <code>2013-05-10</code>, cause no period covers from <code>2013-04=30</code> to <code>2013-05-05</code></p>
  
  <p>2) to get the period ids (or at least <code>true</code> or any content) for a request from <code>2013-05-06</code> to <code>2013-05-15</code></p>
  
  <p>UPDATE: The main goal is to define if the given period (from <code>2013-05-06</code> to <code>2013-05-15</code> as per example 2) is rentable. The periods in database are available rental seasons, so if any of the day are not covered, the entire stay can not be rented.</p>