query and deleteAll test cases