Update occupied tables query