Testcase for verifying queries