database query method update