Pettigrew Lab

What is a database?

A database is an organized place to keep information so that many people and programs can find it, change it and trust it at the same time. Most databases keep data in tables, like a spreadsheet: one kind of thing per table, one row for each item, one fact in each column. What makes them more than a spreadsheet is the rules, starting with an ID on every row that links the tables together.

Tables, rows and columns

Think of a table as a class roster. Every student is a row. Every heading, like name, grade and homeroom, is a column, and every student gets a value under each one.

Good tables hold one kind of thing each. Students in one table, classes in another, grades in a third.

Why every row gets an ID

Two students can both be named Sam. So every row gets an ID: a number that means nothing and never changes, even if a student changes their name or moves. When another table needs to talk about that student, it uses the number, not the name. Numbers don’t have twins.

How tables link up

Instead of writing a student’s homeroom next to every grade they get, the grades table stores just the student’s ID. The homeroom lives in one place, so you fix it once and every grade follows. That’s what makes a database relational: each fact stored once, and everything else linked to it by ID.

To pull it all back together for a report, you join the tables on those IDs. The language most databases use for that is SQL.

Spreadsheet, database, warehouse, lake

  • A spreadsheet

    Great for one person and a few thousand rows. It gets fragile when a lot of people edit it at once.

  • A database

    For an app or a business that many people and programs use at the same time.

  • A data warehouse

    A copy of data from many systems, reshaped for asking questions and building reports.

  • A data lake

    The raw pile: files, logs and exports kept the way they came in, sorted out later.

Questions people ask

What is an example of a database?

Your school’s student records, a store’s inventory, the accounts behind a phone app, your bank’s transaction history. Anything many people or programs need to look up and update at once usually lives in one.

Is Excel a database?

Not really. A spreadsheet can hold a table, but it doesn’t enforce the rules a database does, like unique IDs and many people changing data safely at the same time. For a small personal list, it’s often all you need.

What is SQL?

SQL, said like “sequel” or spelled out, is the language most databases use for asking questions of the data: find these rows, join these tables, add these up.

Learn it by doing it

Module 3, “Where Data Lives,” covers this in four lessons, from “Two Sams, Zero Mix-ups” to why most of the world still runs in batches.

Data to AI is five-minute lessons on how AI works, starting with the data on your phone, for curious teens, parents and grandparents. No math needed. The first lesson runs right here in your browser.

Keep going