Create Database in SQLite

SQLite Create Database

To create a new database in SQLite, the sqlite3 command is used.

Syntax:

sqlite3 DatabaseName.db

To create a database:

  • Open the command prompt.
  • Set the path.
  • Check the SQLite directory.

Command: dir

  • Create a database.

Example: sqlite3 example.db

  • Check the created database.

Command: .databases

  • Or check the created database in the root folder.

 

SQLite .quit Command:
Used to exit the SQLite prompt:

Syntax:

.quit

SQLite .dump Command:
Used to export a complete database in a text file. The exported file can be checked in the root folder.

Example:

sqlite3 example.db.dump > example.sql