Updates sql queries