Populate database functionality