Technology & Computing · Data & digital information
What a database is
See how tables, rows and keys organize records, how one SQL question pulls out an answer, why a spreadsheet stops being enough and when other kinds of database fit better.

What you will learn
- Describe how a relational database organizes records into tables of rows and columns
- Explain how a primary key identifies a row and a foreign key links two tables
- Read a simple SQL query that picks columns, filters rows and sorts them
- Explain how a join uses a key to combine rows from two tables
Lesson 1 of 4 · 4 min
Tables, rows and the keys that tie them together
Your bank balance, your seat on a train and the messages in your inbox all sit in databases. Most of them follow one idea from 1970, when Edgar Codd at IBM proposed keeping data in tables.
Before that, many databases stored records as chains. A program found data by following pointers from one record to the next, much like following arrows on a map. Codd wanted something you could simply search.
Say a small library keeps its records in a relational database. It has one table for members, one for books and one for loans. Each table holds one kind of thing.
Each row is one instance of that thing, such as one member. Each column is one detail, such as a name or a join date. Every row in a table has the same columns, and each column holds one type of data, such as dates or whole numbers.
Two members could both be called Ana Silva. So each row gets a primary key, a value no other row in the table shares. Often it's just a number made for the purpose, like member 1042.
Now the loans table doesn't copy Ana's name and address. Each loan row stores her member number and the book's number. A column that holds another table's primary key is called a foreign key, and it links the two tables.
This is why each fact can live in one place. If Ana moves, the database changes one row in the members table, and every loan still points to the right person.
Copy her address into every loan instead, and a move means updating dozens of rows. Miss one, and the database now holds two addresses for the same person, with no way to tell which is right.
Try to recallIn a library database, why does the loans table store a member's ID number instead of the member's name and address?
The ID is a foreign key that points to one row in the members table, where the name and address live. That way the address is stored once. If it changes, one row is updated and every loan stays correct, instead of copies drifting apart.
A relational database keeps each kind of thing in its own table, one row per item. Keys tie the tables together, so you can now explain why a change of address touches just one row.
Lessons in this topic
Tables, rows and the keys that tie them together
See how a database splits records into tables of rows and columns, and how keys let one table point to another so each fact is stored once.
How to ask a database a question in SQL
Read a short SQL query that picks columns, filters rows and sorts them, and see how a join uses keys to combine two tables into one answer.
When a spreadsheet stops being enough
See how a row limit in an old spreadsheet format lost thousands of test results in 2020, and what a database adds for many users and for rules about valid data.
Databases without tables, and when they fit
Meet key-value stores, document stores and graph databases, see what each does well, and why tables still win for many jobs.
Three quick stories from this topic
The 65,536-row limit
An old Excel file format left nearly 16,000 Covid cases out of England's figures in 2020
Public Health England loaded lab results into templates in the 1987 XLS format, which stops at 65,536 rows. Each result used several rows, so cases past about 1,400 a template were silently dropped.
What it cost
Between 25 September and 2 October 2020, 15,841 positive cases missed the daily figures, and tracing their contacts was delayed.
The fix
PHE split the data into more, smaller templates. The newer XLSX format holds 1,048,576 rows a sheet.
The first NoSQL
The first database called NoSQL, in 1998, still kept its data in relational tables
Carlo Strozzi gave the name to his small relational database because it didn't use the SQL language. The 2009 movement that borrowed the name dropped tables altogether.
His objection
Strozzi said the later movement left the relational model behind, so it should have been called NoREL.
What NoSQL means now
Key-value, document, graph and wide-column databases, often built to spread across many machines.
Why SQL lost its vowels
SQL was first called SEQUEL, until the name turned out to be a British company's trademark
IBM researchers Donald Chamberlin and Raymond Boyce named their query language SEQUEL in the 1970s. The name belonged to Hawker Siddeley Dynamics Engineering, so they dropped the vowels.
Still said both ways
The standard says the letters, S-Q-L. Many database people, Chamberlin included, still say "sequel".
Why it spread
IBM built products on it, Oracle sold one of the first versions in 1979, and it became a US standard in 1986.
Sources
- Relational database, Wikipedia
- Database, Wikipedia
- Edgar F. Codd, Wikipedia
- PostgreSQL tutorial, Concepts, PostgreSQL Global Development Group
- Primary key, Wikipedia
- Foreign key, Wikipedia
- Database normalization, Wikipedia
- Excel: Why using Microsoft's tool caused Covid-19 results to be lost, BBC News
- Microsoft Excel, Wikipedia
- NoSQL, Wikipedia
- SQL, Wikipedia





