SQLite

SQLite is a file-based SQL database system.

Installation

  • download the “command line shell” for “sqlite3” from SQLite download page. For Windows download sqlite-shell-win32-x86-3081002.zip web.
  • create a directory where you want to install sqlite3 (e.g. %SCRIBESTOOLS%\SQLite)
  • extract the archive (only one file on windows: sqlite3.exe)
  • move the content of the archive to the directory created
  • add %SCRIBESTOOLS%\SQLite to the path.

On Ubuntu you can install SQLite as following:

sudo apt-get install sqlite3

Launching SQLite

You can test the installation and check the version of sqlite3 with the following command:

sqlite3 -version

Then try:

sqlite3

This should launch the SQLite shell. Try the following commands:

.help
.schema
.quit

Since no database has been specified when launching the shell command the .schema command will not display anything.

Sqlite3 for django

If you use SQLite with django, then you can launch the shell with the following commands:

python manage.py dbshell

Documentation

The documentation is available online (SQLite documentation).

To get some help about the command line type:

sqlite3 -help

If you want some brief help about the shell commands (including SQL) you can type in the shell:

.help

More generally, the documentation of the shell is available at https://www.sqlite.org/cli.html