Fixed some errors in select query
Added select query test cases