Lesson 1 of 7
Lesson 1 — Why Databases Beat Spreadsheets
What a database actually is, and why apps store data in one instead of a giant file.
Learn it
A database is organised storage that lets many people read and write data at the same time without corrupting it.
Data lives in tables: rows are records (one student), columns are fields (name, year group, house).
A DBMS (Database Management System) like MySQL, PostgreSQL or SQLite handles searching, security, backups and crash recovery for you.
Spreadsheets are fine for a few hundred rows you own. Databases handle millions of rows, many users and strict rules.
Key terms
- Database
- An organised, persistent collection of related data.
- DBMS
- Software that stores, secures and queries a database (e.g. PostgreSQL).
- Table / row / column
- A record set, one record, and one field of every record.
- Transaction
- A group of operations that all succeed or all fail together.
- ACID
- Atomicity, Consistency, Isolation, Durability — the safety guarantees of a relational DB.
Spreadsheet vs database
A club tracks 4,000 members. What changes when you move to a database?
- 1Concurrency: Ten volunteers can update records at once; the DBMS keeps edits from overwriting each other.
- 2Validation: A 'join date' column only accepts real dates, so bad data never gets in.
- 3Speed: An index on surname turns a 4,000-row scan into an instant lookup.
- 4Security: Volunteers can read members but only admins can delete them.
- 5Recovery: Nightly backups plus a write-ahead log mean a crash loses seconds, not the file.
The same data, two ways
sql-- Spreadsheet thinking: one messy sheet
-- Name | Email | Class | Class Teacher | Teacher Email (teacher repeated 30x)
-- Database thinking: two tables, linked
CREATE TABLE teacher (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
email TEXT UNIQUE NOT NULL
);
CREATE TABLE student (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
year_group INTEGER NOT NULL,
teacher_id INTEGER REFERENCES teacher(id)
);The teacher's email is stored once. Change it in one place and every student record is instantly correct.
Try it
Database or spreadsheet? True or false.
A DBMS can stop two rows having the same student ID.
Spreadsheets are better for 50 people editing live customer orders.
'Durability' means committed data survives a crash.
Indexes make every write faster.
Challenge
A youth football league tracks players, teams, matches and scores in one giant spreadsheet. List four specific problems they will hit, and describe the tables you would create instead.
Pick whichever way suits you — every mode earns the same bonus XP.
Write at least 40 more characters to submit.
Mark your own work
Guided walkthrough — 0/3 clues revealed
- Clue 1 locked — reveal it only if you get stuck.
- Clue 2 locked — reveal it only if you get stuck.
- Clue 3 locked — reveal it only if you get stuck.
Each clue costs 4 XP (never below 18 XP). You'd earn 35 XP right now.