update query from from database