SQL is "default SQL cursor" - one main cursor, useful for apps dealing with just one database. That line in fact defines that this default cursor will refer to created SqlLite session.
Now those scripts. U++ is able to generate a couple of database scripts from the .sch files:
* script that creates schems tables by adding individual columns
"adding individual columns" is quite imporant, as that way you are able to "upgrade" existing database schema in most cases - you just run the script, statements for existing columns will fail, but those that are not there yet will succed and upgrade schema
* script to add "attributes" to columns - attributes here are constraints or indexes
* script to drop "attributes" - note that this is often useful and harmless to stored data to recreate attributes (drop + add).
* script to wipe the schema out - seldom used and not present in the example
* script to perform initial setting of table content - for configuration tables etc...
All_Tables here creates those scripts - they are stored in Strings inside "sch".
Now performing script can be quite long operation, something you do not want to do each time you start your code. That is the reason for "ScriptChanged" - it tests whether script differs from the one stored inside "exe-directory".
"SaveNormal" then stores scripts into exe-dir.
Note that those script issues are usually present only in debug code. When delivering application, you can either execute scripts from exe-dir, or you can run debug version against customers database engine (recently, I prefer later).