Free Web Book: What a Database Is, in Six Short Chapters
This is a short book you can read right here, in one sitting or one chapter a day. There is nothing to download or sign up for. It is written for someone who has never used a database and wants the big picture before diving into details.
Chapter 1: data is everywhere
Every app you use remembers things: your messages, your playlists, your orders. That remembered information is data. Some apps store a little; some store billions of records. Either way, they need somewhere reliable to keep it and a way to find it again quickly.
Chapter 2: tables, rows and columns
Most apps organise data in tables, a bit like spreadsheets. Each table is about one kind of thing:
| id | name | |
|---|---|---|
| 1 | Ana | ana@example.com |
| 2 | Ben | ben@example.com |
Each row is one record (one person). Each column is one kind of fact (their email). The id column gives every row a unique number, called a primary key, so we can always point to exactly one row.
Chapter 3: the database engine
A database is more than a file of tables. Software called a database management system looks after it. It:
- stores data safely on disk
- finds data quickly when asked
- lets many people use the data at once without trampling each other
- enforces rules, such as "every user must have an email"
- recovers cleanly if the computer crashes
SQLite, PostgreSQL, MySQL and SQL Server are all database management systems.
Chapter 4: asking questions with SQL
We talk to relational databases in SQL, a language for describing what data we want:
SELECT name FROM users WHERE id = 2;
That reads almost like English: give me the name from the users table where the id is 2. SQL can also add, change and remove data, and create tables.
Chapter 5: how apps connect
Your app does not open the database file and read it directly. It uses a driver, a library for your programming language, to send SQL and receive results:
import sqlite3
conn = sqlite3.connect("app.db")
for (name,) in conn.execute("SELECT name FROM users"):
print(name)
For server databases, the app connects over the network using a connection string that says where the database is and how to log in.
Chapter 6: where to go next
You now have the big picture: data lives in tables, a database engine manages it, SQL asks questions, and a driver connects your app. The rest of learning is filling in details, one at a time.
| Next topic | Page |
|---|---|
| Creating your own table | How to create your first SQLite database and table |
| Asking better questions | SELECT queries in five short modules |
| Linking tables | A picture-by-picture guide to keys |
| Connecting from code | Connecting a Python script to SQLite |
Afterword
If something in this book felt too fast, that is normal. Come back to a chapter later; ideas often click the second time, especially after you have typed a few queries yourself.
A free learning page for beginners. Practise on a test database, never on real customer data, and check the official documentation for your database version.
This page is a free outline. No downloadable files, paid content, courses or certificates are offered on this site.