Test case for Select query