Allow queries to be supplied as tables