how to get tables inforamation through query