Added complex query test case