Free preview
Setting up DB Browser for SQLite
Practical task · 20 min
DB Browser for SQLite is a free, open-source app that lets you create SQLite databases, browse their tables and run SQL. It works on Windows, macOS and Linux.
- 1
Install it
Go to sqlitebrowser.org, open Download and install the version for your system.
- 2
Create a database
Open the app and choose New Database. Save it as
shop.dbin a folder for this course. If a "create table" window appears, press Cancel: we'll create tables with SQL instead. - 3
Open the SQL tab
Click the Execute SQL tab. This is where you'll type queries.
- 4
Run the setup script
Paste the script below and press the ▶ Execute button (or Ctrl+Enter / Cmd+Enter). Then press Write Changes (Ctrl+S) to save.
- 5
Check the data
Open the Browse Data tab and pick each table from the drop-down to see its rows.
The course database
We'll use a small online shop throughout the course:
CREATE TABLE customers (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
city TEXT,
joined DATE
);
CREATE TABLE products (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
category TEXT,
price INTEGER NOT NULL
);
CREATE TABLE orders (
id INTEGER PRIMARY KEY,
customer_id INTEGER REFERENCES customers(id),
ordered_on DATE,
status TEXT
);
CREATE TABLE order_items (
order_id INTEGER REFERENCES orders(id),
product_id INTEGER REFERENCES products(id),
quantity INTEGER NOT NULL
);
INSERT INTO customers VALUES
(1,'Ada Okafor','Lagos','2026-01-14'),(2,'Kwame Mensah','Accra','2026-02-02'),
(3,'Grace Wanjiru','Nairobi','2026-02-20'),(4,'Tunde Bello','Lagos','2026-03-09'),
(5,'Amara Diallo','Dakar','2026-04-11'),(6,'Chi Eze','Abuja',NULL);
INSERT INTO products VALUES
(1,'Rice 5kg','Food',8500),(2,'Palm oil 1L','Food',2800),(3,'Phone charger','Electronics',4500),
(4,'Earbuds','Electronics',12000),(5,'Notebook','Stationery',900),(6,'Pen pack','Stationery',1200),
(7,'Kettle','Home',15500);
INSERT INTO orders VALUES
(1,1,'2026-05-01','delivered'),(2,2,'2026-05-03','delivered'),(3,1,'2026-05-10','delivered'),
(4,3,'2026-05-12','cancelled'),(5,4,'2026-06-02','delivered'),(6,5,'2026-06-05','pending'),
(7,2,'2026-06-07','delivered');
INSERT INTO order_items VALUES
(1,1,2),(1,2,1),(2,4,1),(3,5,5),(3,6,2),(4,7,1),(5,3,2),(5,1,1),(6,4,2),(7,7,1),(7,2,3);Don't worry about understanding every line yet: by the end of the course you'll write scripts like this yourself.
Your first query
In Execute SQL, clear the box and run:
SELECT * FROM products;You should see seven products. * means "every column".
Try it
Explore the data
Run SELECT * FROM for each of the four tables. How many customers are there? Which customer has no join date? Which order has status "pending"?
Show a worked answer
Six customers; Chi Eze has no join date (it shows as NULL); order 6 is pending.
Like this lesson?
SQL & Database Fundamentals has 17 lessons with exercises, quizzes and a final project.