SELECT *
FROM `rooms`
WHERE `hotel_id` = $hotel_id
WHERE `people` = $people
WHERE `id` NOT IN (
SELECT `room_id`
FROM `orders`
WHERE `hotel_id` = $hotel_id
WHERE `date_from` < $date_to AND `date_to` > $date_from
)
SELECT Author, Name, genre.Genre, publishing.Publishing, Year, Tom, book.Acquired, Cost, FIO, Prima