What SQLite is good for
🏠The everyday picture
A pocket diary versus an office records room. The diary goes everywhere, needs no staff and is perfect for one person. The records room serves a whole office at once.
📘What it really is
-
SQLite is a complete SQL database in a single file, run as a library inside your program: no separate server, no set-up, no passwords.
-
It's one of the most widely used pieces of software in the world: inside every Android and iPhone, every web browser, and countless apps.
-
Good for:
- learning SQL (as you've done);
- mobile and desktop apps;
- tests (a fresh database per test run, very fast);
- small and medium websites with modest write traffic, on a single server;
-
tools, prototypes and local data files.
-
Less suited for:
- many servers sharing one database (it's a file on one machine);
- very high numbers of simultaneous writes (it allows one writer at a time, though writes are quick);
-
needing database users and roles (whoever opens the file controls it).
-
Services like Turso and Cloudflare D1 offer SQLite as a hosted service, extending where it fits.
- SQL you learned works the same, with some differences: few data types (use
STRICTtables), dates stored as text or numbers, limitedALTER TABLE, and foreign keys switched on per connection (Module 53).
🖱️Try it
Install the sqlite3 command-line tool (from sqlite.org, or your system's package manager). Open your database with
sqlite3 crm.db, run .tables, .schema customers, and one of your report queries. Exit with .quit.
✅Quick check
Why is SQLite a good choice for automated tests?
Show the answer
A fresh database file (or in-memory database) can be made instantly for each test run, with no server to set up.
Why is SQLite a poor fit when several servers must share one database?
Show the answer
It's a file on one machine, accessed as a library, not a server others can connect to.
