Most recently, I worked with SQLite databases (on Android), but I think that when they write CREATE statements, they always do this with the IF NOT EXISTS clause (i.e. CREATE (DATABASE|TABLE) IF NOT EXISTS... ) .
I don’t know what you will use SQLite for, but I believe that they do it in Android “just to make sure”. That is, if this is the first time the user launches the application, DB / Tables should be created first, the application goes to bonkers. Otherwise, they are (probably) already created, and this case will be handled with the IF NOT EXISTS clause, and they just go ahead and create a connection to the existing database. Win-win.
(If for some reason the user is not using the application for the first time, and the database is not there, it will simply be created again. But this is obvious, isn't it ?;))
source share