what are the steps to run a quary