Update sql queries