Installing and uninstalling queries