db initialization and sql