database generation final