Compute column statistics with sql