I am trying to build search query for hotel rooms availability but it seems that his query is way over my head, and i needhelp to build it. Note that there will be multiply hotels in the database.

Even that I am looking for available rooms, my idea was not to build availability table, but instead to use reservationtable, and I assume that if the room is not in the reservation table, it is available. (If you have any suggestions about this solutionI would like to hear it)

I have the following fields in the search form:

area (represented with areaid), checkInDate, checkOutDate, rooms (how many rooms he need), adults and children's.