updated sql scripts for changed database schema