refactored table overbooking validation query