Added code to create database and table if it doesn't exist