SQLite

Basic notes on setting up sqlite

Updated: 23 September 2025

Notes on using Sqlite, the getting started docs

Init a DB

A database file named mydb.db can be instantiated with:

Terminal window
1
sqlite3 mydb.db

This will also start the prompt

Using the Prompt

You can do things with the DB as normal using SQL, followed by ; to run the query, for example we can create a table, insert some entries, etc.

Terminal window
1
sqlite> CREATE TABLE Persons (id int, name text, city text);
2
sqlite> INSERT INTO Persons (id, name, city) VALUES (1, "Bob", "New York");
3
sqlite> SELECT * FROM Persons;
4
1|Bob|New York

And whatever SQL stuff like you’d normally do

References