Now generates table queries