1

Topic: Procedure/inquiry on amounts of vacant rooms for current date in Hotel

In general, there is  a Hotel, figuring tables - Numbers (number Code, the code of a category of number, capacity, residing cost), Booking (the armor Code, number code, , armor date), the operation Registration (the operation code, number code, the code of the client, settling date, eviction date). It is necessary to create procedure or request (though that that would work) which () deduces an amount of vacant rooms (i.e. eviction date is null and in booking do not figure) for current date. How it is all to issue in MS SQL Management Studio 2008? Help please, and that I  that that: (

2

Re: Procedure/inquiry on amounts of vacant rooms for current date in Hotel

And here still, date of eviction or null or more than leaking turns out. After all the client could be moved one week ago, but same does not mean that number is occupied

3

Re: Procedure/inquiry on amounts of vacant rooms for current date in Hotel

Julia87968 wrote:

And here still, date of eviction or null or more than leaking turns out. After all the client could be moved one week ago, but same does not mean that number is occupied

Vacant rooms, these are numbers for which there are no records in the operation Registration, where settling date <leaking, And (eviction date> leaking OR eviction date = NULL)
Correctly?
Here also write request from Number table, with aforementioned condition NOT EXISTS on the table the operation Registration