Creating and populating a database table