added an improved version of daatabase and table creation queries