An Analytic Approach to Statistical Databases