Query generation by data summary profile