difference between qaury and mining