get_sample_count in database class