Hi Saba,
U need to write code to implement this.
Write a query in a webservice to find out whether the "From Time" and "To Time" in ur InfoPath form conflicts with the "From Time" and "To Time" entered in the database for a particular room on that particular date.
If there is no conflict,then insert a new row into the database.
U can implement this on a single call to a web service.
Regards,
Abhishek