SQLStatistics: finished implementation and test