Booking manager: sql query adapted to cortestella db