Added database table creation file and fixed some undefined errors