add from and join method for query class