Completed test cases for union and query without table names