You do not have to install anything, sqlite3 is pre-installed.
Just get command line access and type the two commands as shown.
The collection('s) data base is in the user's persistent storage (/var/local) because it needs to stay in sync with the (similar) data base in the user's account on the Amazon server(s).
There is no telling what might go wrong if the user could diddle the contents from visible user storage.
The only technical thing to do to turn those two examples into runme.sh scripts is make the first line read:
And of course, name it correctly (basename upper case and extension lower case).