How to start working with SQLite database in Windows

SQLite is one of the top ranking databases in the world. It’s a self-contained, serverless and zero-configuration database engine. So in the tutorial, JavaSampleApproach will guide how to start working with SQLite database in Windows.

I. Install SQLite

Go to SQLite download page, download the file as below image:

sqlite download

Extract the file, we have:

install sqlite - 3 files

Create a folder: C:\sqlite, then copy 3 files: {sqldiff.exe, sqlite3.exe,
to C:\sqlite.

Add C:\sqlite in PATH environment variable:

install sqlite - add environment variable

-> Now, open a command prompt and enter a commandline: >sqlite3

install sqlite - enter sqlite3

-> It works fine!

II. Try with SQLite commands

– Create testdb.db SQLite database with commandline:

sqlite3 testdb.db

– Check the database list by commandline:


– Create a customer table by commandline:

sqlite> CREATE TABLE customer(
   firstname TEXT NOT NULL,
   lastname TEXT NOT NULL

-> check list table in the database by commandline:


– Insert some record to SQLite database:

INSERT INTO customer (id,firstname,lastname) 
VALUES (1, 'Jack', 'Smith');

INSERT INTO customer (id,firstname,lastname) 
VALUES (2, 'Adam', 'Johnson');

INSERT INTO customer (id,firstname,lastname) 
VALUES (3, 'David', 'Williams');

Select all customer’s records:

SELECT * FROM customer;

-> Results:

sqlite command results

SQLite is ready for development!

Leave a Reply

Your email address will not be published. Required fields are marked *