Updated SQL scripts

- Updated all the SQL scripts to match the new database structure