Start here · no experience needed

How databases actually work

What a database is, what it's doing under the hood, and why there are so many of them with different names. Written for people who live in spreadsheets and have started bumping into their limits.

On this page

It's a spreadsheet… until it isn't

If you know Excel, you already understand most of a database. A table is a worksheet. A column is a column. A row is a row. That's not a simplification to be polite — it's genuinely the same shape.

The difference is what surrounds it. A spreadsheet is a file you open. A database is a program that runs, guards the data, and answers questions about it. You never open the file; you ask the program.

The one-line version: a spreadsheet holds data. A database manages data — who can read it, who can change it, how to find things fast, and what must never be allowed to happen.

What's inside a database

Four ideas cover almost everything:

Those keys are why you don't repeat the customer's name and address on all 47 of their orders. You store the customer once and point at them. Change the address in one place and every order reflects it — no find-and-replace, no drift.

In spreadsheet terms: a foreign key is a permanent, enforced VLOOKUP. It can't go stale, can't point at a deleted row, and doesn't break when someone inserts a column.

Want to see real ones? The schema explorer draws the keys and relationships of every sample database on this site.

What happens when you run a query

A database is a server: a program sat waiting for requests. Your tool — DBeaver, Excel, this website — is a client. Here's the whole round trip:

1

You send SQL. The client opens a connection (a host, a port, a username) and sends your statement as plain text.

2

The database parses and plans it. It checks the SQL makes sense, then a component called the query planner works out how to get your answer — which is often not the order you wrote it in.

3

It uses indexes to avoid reading everything. An index is a sorted lookup structure — like the index at the back of a book. Without one, finding a customer means reading every row. With one, it's a handful of jumps. This is the single biggest reason databases stay fast at a million rows.

4

It reads the rows and builds a result set. Filtering, joining and totalling all happen inside the database, on the server — not on your laptop.

5

It sends back only the answer. Ask for one number and you get one number, even if it summed a million rows to get there.

Why that last point matters: Excel has to load the whole workbook to total a column. A database totals 8.8 million dollars of payments across 273 rows — or 273 million — and sends you back a single number. The work happens where the data already is.

You can watch this happen: every response from our REST API includes the exact sql it ran, and the SQL Editor shows results the moment the server replies.

Why not just use Excel?

Use Excel. It's excellent. But the moment more than one person needs the same numbers, the cracks show:

📄 A spreadsheet

  • One person edits at a time — or you reconcile copies by hand
  • Anyone can type text into a number cell
  • Slows down badly past ~100k rows
  • The formula and the data live together, so both can break
  • "Final_v3_REAL_final.xlsx"

🗄️ A database

  • Hundreds of people read and write at once, safely
  • Column types and keys reject bad data on entry
  • Millions of rows, answered in milliseconds, via indexes
  • One copy of the data; every report asks the same source
  • Changes are transactional — all of it happens, or none of it does

That last one deserves a name. A transaction means a group of changes succeeds or fails as one unit. Moving $500 between accounts is two steps — debit one, credit the other — and a database guarantees you can never end up having done only the first, even if the power dies in between. Accountants have a word for systems without that guarantee: out of balance.

The types of database

You'll hear a lot of names. Almost all of them fall into two camps:

Relational (SQL) — what you're here for

Data in tables, with keys wiring them together, queried with SQL. Every example on this site is relational. If your data has a natural shape — customers have orders, orders have lines — this is the right tool, and it's the overwhelming default in finance and accounting.

Non-relational (NoSQL)

A family of databases that deliberately drop the table structure for something looser — documents (MongoDB), key-value pairs (Redis), graphs (Neo4j). They're built for problems like caching, huge unstructured logs, or social networks. They are not a newer, better version of relational databases, and you almost certainly don't need one to analyse financial data.

Don't overthink this. "Learning databases" in a finance context means learning relational databases and SQL. NoSQL is a different tool for different problems, not the next level up.

SQL Server vs MySQL vs the rest

These are all relational databases that speak SQL. They differ in who makes them, what they cost, and where you'll run into them — far more than in how you query them.

On this site

Microsoft SQL Server

The enterprise standard in corporate finance. If your company runs Dynamics, or your accounting system has a Microsoft back end, this is very likely what's under it.

Made by
Microsoft
Cost
Paid (a free Express edition exists)
Its SQL dialect
T-SQL — uses SELECT TOP 10
You'll meet it in
Corporate ERP, Dynamics, Power BI shops
On this site

MySQL / MariaDB

The most widely deployed open-source database, and the friendlier one to learn on. MariaDB is a compatible fork of MySQL — for learning purposes they're the same thing.

Made by
Oracle (MySQL) / community (MariaDB)
Cost
Free, open source
Its SQL dialect
Uses LIMIT 10
You'll meet it in
Web apps, WordPress, most of the internet
Not here

PostgreSQL

Free, open source, and the darling of data teams — very standards-compliant and strong at complex analytical work. A great third one to know.

Cost
Free, open source
You'll meet it in
Startups, data engineering, analytics
Not here

SQLite

A whole database in a single file, with no server at all. It's on your phone right now. Perfect for small, local, single-user data.

Cost
Free, public domain
You'll meet it in
Phones, browsers — and the Sandbox mode of our SQL Editor, which runs SQLite inside your browser
The good news: SELECT, FROM, WHERE, JOIN and GROUP BY are identical in all four. Learn SQL once and you can work with any of them; the differences are dialect trivia you look up when you need it. We've tabulated the exact SQL Server vs MySQL differences here →

Which should I learn?

Neither — learn SQL. The language is the transferable skill; the engine is a detail of whichever job you're in. That said, if you want a practical answer:

Both engines on this site carry the same sample databases, so you can run an identical query against each and watch what changes. That's the fastest way to stop worrying about it.