Skip to content
BENIBIX Learn

SQLite

Development🗃️ DatabasesRelational Databases

Also known as SQLite3, Sqlite

A tiny SQL database in one file. There is no server to run.

Think of it like

Think of it like a notebook in your pocket. It is small, but it is always with you.

Example

Emma's phone app keeps its notes in an SQLite file. Python can open the same kind of file with no extra install.

Why it matters

SQLite gives you a real SQL database with zero setup. It is great for learning and for apps.

Definition

SQLite is a small SQL database that lives in one file, with no server to run. The app reads and writes that file directly. It is built into phones, web browsers and Python, which makes it one of the most used programs in the world. It is perfect for apps, tests and small sites. It is less suited to many users writing at the same moment.

Example code

python
import sqlite3
con = sqlite3.connect("shop.db")  # makes the file if needed
print(sqlite3.sqlite_version)
# 3.46.1
One line makes a whole database in a file called shop.db.

Common mistake

Using it for a busy website with many writers at once. It allows only one writer at a time.

Key takeaways

  1. 1
    One file. The whole database is a file.
  2. 2
    No server. The app opens it directly.
  3. 3
    One writer at a time. Fine for apps, not big sites.

Compare