how to apply for quary mining