|
Databases

Databases explained for beginners

A spreadsheet stops answering questions once it grows. A database does not. Here is what tables, rows, keys and queries mean, in plain language, with the first thing to build.

Databases explained for beginners

A woman who sells hair extensions from her flat in Lekki sent me her database last year. It was a WhatsApp chat export, a notebook, and a Google Sheet with 611 rows. She had run the business for three years and could not answer a simple question: which customer spent the most money in the last six months?

She could have answered it. It would have taken two evenings and a headache. A database answers it in under a second, every time, without her touching a formula.

That is what a database is for. Not storage. Answers.

The spreadsheet is a database until it isn't

Beginners get confused because a spreadsheet looks like a database and, for a while, behaves like one. Rows, columns, totals. It works. Then the sheet grows past a few thousand rows and things start to feel wrong.

The formulas get slow. Two people editing at once create conflicts. Someone sorts only half the columns and quietly destroys the order of the data. A phone number starting with zero loses the zero. And you cannot easily ask a question that spans two sheets without writing something ugly.

I have watched small businesses run on a single sheet for years. It is not stupid. It is cheap and everyone knows how to use it. The problem starts when the business depends on the answers and the sheet cannot give them fast enough.

Tables, rows and queries, in plain language

A database stores data in tables. A table is one kind of thing. Customers. Orders. Products. Payments.

Each row is one record, one customer, one order. Each column is one fact about that record: a name, a phone number, a date.

The important part is that the columns have types. A date column stores dates. A money column stores numbers. If someone tries to put "call me later" into a date column, the database refuses. That sounds annoying. It is the whole point. A spreadsheet accepts any nonsense you type and quietly breaks your totals later.

So a customer table might have id, name, phone, email, created_at. An order table might have id, customer_id, total, status, created_at. The customer_id column is the link. It says this order belongs to that customer. That single idea, linking rows by an id, is what people mean when they say relational database.

In the sheet, the customer's phone number is probably typed into every order row. So when she changes her number, someone has to update 40 rows and will miss three.

In a proper database, the phone number lives in one place, the customer row. Orders point to the customer. Change it once and every order shows the new number.

That is normalisation, a word that scares beginners. It just means do not store the same fact twice. Store it once where it belongs and point to it.

A query is a question written in a language the database understands. For most small apps that language is SQL, and the basic version is readable English.

SELECT name, phone FROM customers WHERE created_at > '2026-01-01';

That says: give me the name and phone of every customer who joined this year. You can read it out loud. That is not an accident. SQL was designed to be read.

You will spend most of your early database life writing four things: SELECT to read, INSERT to add, UPDATE to change, DELETE to remove. That is the entire core. Everything else is detail on top.

The database you should touch first

Do not start with MySQL on a server. Start with SQLite. It is a single file on your laptop, it installs in one command, and it speaks almost the same SQL. You can create a table, insert 20 fake customers, and run a query before your data finishes downloading. Nothing to configure, nothing to pay for, no server to keep alive.

When you outgrow it, and most small projects never do, move to PostgreSQL or MySQL. By then you will understand tables, keys and queries, and the move is just learning a new set of commands, not a new way of thinking. If you want to see a full small app come together, the software development course builds one from an empty table.

Two mistakes I made

I once stored every customer's full address as one text blob. It looked tidy. Then I needed to group orders by state for a delivery estimate and could not, because the state was buried inside a paragraph. Split address into street, city and state columns and the question becomes easy.

The other mistake was deleting rows. A customer asked to be removed, so I ran a DELETE and lost the order history attached to her. The right move was to mark the row inactive, not erase it. Data that disappears cannot be audited.

Your first move

Open a terminal, install SQLite, and build two tables: customers and orders. Put five fake customers in. Put ten fake orders in, each pointing to a customer. Then write one query that lists every order with the customer's name next to it. When that query returns the right rows, you understand databases better than most people who have watched a 12 hour course.

Then read how to build your first CRUD app to see those tables become screens, and what an API is to understand how the app talks to the database.

Dave Partner

Dave teaches digital skills at Braintem and has helped thousands of Nigerians move from watching tutorials to charging for real work. He writes about the parts nobody puts in the course trailer.