Comparing Time Periods or Date Ranges with SQL
TL;DR
SELECT * FROM periods
WHERE range_start <= @check_period_end
AND range_end >= @check_period_start
The opposite:
SELECT * FROM periods
WHERE NOT (range_start > @check_period_end
OR range_end < @check_period_start)
The explanation is here: https://stackoverflow.com/a/143568