Removed non-template related queries from database scripts