You are on page 1of 2

Follow the below steps to install sqlite3 on your computer

Installing SQLite on Windows

1. Go to the SQLite download page (https://www.sqlite.org/download.html) and download the binary


sqlite-tools-win-x64-202401041713.zip for Windows. (If there is a more recent version, you
can download that. Filename would start with “sqlite-tools-win")
2. Unzip the directory and rename it to “sqlite”. Move the folder to your “C:\” drive. So that the path looks
like this “C:\sqlite”.
3. Add the “C:\sqlite” directory to your PATH environment variable:
1. Hit Windows key and search for ‘edit the system environment variables’ (control panel), and
click ‘edit the system environment variables’ to open the window. (You can also search ‘Edit
Environment Variables’ in the Start menu.)
2. If you are on the “System Properties” window, then click on “Environment Variables” at the
bottom of the window.
3. On the “Environment Variables” window, click the “Path” variable either in the:
1. System Variables section, and click on “Edit” OR
2. User Variables section, and click on “Edit”
4. Click on the “New” button, add the “C:\sqlite” and then click on “OK”.

4. Test the installation by opening a command prompt and running the command “sqlite3”. You should see
the SQLite prompt (sqlite>).
Installing SQLite on Linux

1. Open a terminal and run the command:


sudo apt-get install sqlite3
2. Test the installation by running the command sqlite3. You should see the SQLite prompt.

Installing SQLite on Mac

1. Open a terminal and run the command:


brew install sqlite
2. Test the installation by running the command sqlite3. You should see the SQLite prompt.

To create a Database (In SQLite, a .db file is created):

Open command prompt / terminal and navigate to the directory where you want to keep the database

Use the command:

sqlite3 YOUR_DB_NAME.db

Some helpful commands which you would require with SQLite3:

.open FILE_NAME.db To open your database which stored in the .db file.

.header on To enable the Column Headers to be returned along with the queried data.

.mode table To make your SQL results more readable.

.quit To exit the sqlite3 command line interface.

You might also like