sql script to generate db