Q:

SQL Storage logic between two dates

I would really like to have your help. I'm getting the following problem.
I have a products store app, that a I input two dates (DATETIME), the initial and the final date.
And a I need to validate all the exceptions, for example:
I reserved an item from 

15:00 to 17:00.

Then I CAN'T reserve this item during this time.
Here go some examples: 

From 14:00 to 16:00 [ no ]
  From 15:00 to 16:00 [ no ]
  From 16:00 to 18:00 [ no ]
  From 12:00 to 14:00 [ yes ]
  From 17:00 to 19:00 [ yes ]

Look this code, that's what I already could do. (noob).
SET @START = DATE('2013-06-06 15:30:00');
SET @FINAL = DATE('2013-06-06 16:00:00');

INSERT INTO `store` (`start_date`, `final_date`) VALUES ('2013-06-06 15:00:00', '2013-06-06 17:00:00');
SELECT IF(COUNT(*) > 0, 'NO', 'YES') FROM `Store` WHERE
    (`start_date` BETWEEN @START AND @FINAL); -- OUTPUT 'NO'

With this code I resolve the problem that I can validate what's BETWEEN the two dates, but if one of the dates informed are out of those ranges it fails.
Remembering that I can use a backend language to help too.
Thank you 

A:

Check to see if either of the "attempt to reserve" date/times fall between the "reserved" date/time range:
SELECT IF(COUNT(*) = 0, 'NO', 'YES')
FROM Store
WHERE @Start BETWEEN start_date AND final_date
   OR @Final BETWEEN start_date AND final_date

If the count is zero, the time slot is not reserved. If it's greater than zero, the time slot is reserved.

