Histogram-Based Solutions to Diverse Database Estimation Problems