I'm using the SQLite Command Line Shell. As documented, I can open a database by supplying it as an argument to the executable:
sqlite3 data.db
I cannot figure out how to open a database file from within the tool after having invoked it without supplying the file as a command-line argument (if I, say, double-click sqlite3.exe in Windows). What is the command within the SQLite shell tool to specify a database file?
You can simply specify the database file name in the command line:
Moreover, you can execute your query from the command line:
You could attach another database file from the SQLite shell:
The tables from this 2nd database will be accessible via prefix of the database:
But who knows how to specify multiple database files from the command line to execute the query from the command line?
The command within the Sqlite shell to open a database is .open
The syntax is,
If it is a new database that you would like to create and open, it is
If the database is existing in a different folder, the path has to be mentioned like this:
In Windows Command shell, you should use '\' to represent a directory, but in SQLite directories are represented by '/'. If you still prefer to use the Windows notation, you should use an escape sequence for every '\'