sql queries updated