Database creation and tests