SQLite creates database
SQLite’s sqlite3 command is used to create a new SQLite database. You don't need any special permissions to create one.
Syntax
The basic syntax of the sqlite3 command is as follows:
Normally, the database name is in Should be unique within the RDBMS.
Example
If you want to create a new database <testDB.db>, the SQLITE3 statement is as follows:
SQLite version 3.7.15.2 2013-01-09 11:53:05
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
The above command will create a file testDB.db in the current directory. This file will be used as a database by the SQLite engine. If you have noticed that the sqlite3 command will provide a sqlite> prompt after successfully creating the database file.
Once the database is created, you can use SQLite's .databases command to check whether it is in the database list, as follows:
seq name . -
0 main /home/sqlite/testDB.db
.quit command to exit the sqlite prompt, as shown below:
.dump point command in the command prompt to Export the complete database in a text file as follows:
testDB.db Convert the contents of the database into SQLite statements and dump them into the ASCII text file testDB.sql. You can restore from the generated testDB.sql in a simple way as follows: