added unit tests for table queries