update database query.