update assuming consistent query tables(1 less for loop)