This is a free preview. Enrol on the course to save your progress and open every lesson.

Lesson 1 of 32 · 10 min

What a database is

Tables, rows and columns

A database keeps information organised so you can find it, change it and trust it. A relational database like PostgreSQL stores it in tables — a bit like spreadsheets:

idnamepricevegetarian
1Flat white4.80true
2Latte4.80true
11Ham and cheese toastie9.50false
  • Each row is one thing — here, one item on the menu
  • Each column is one fact about it, and every value in a column has the same type (all prices are numbers, all names are text)
  • Each row has an id that's never repeated, so you can always point to exactly one row

Why not just use a spreadsheet?

A database…Which means
Checks every value against rulesNo "abc" in a price column, no order for a staff member who doesn't exist
Handles millions of rowsFast answers even with years of sales
Lets many people and apps use it at onceThe till, the website and the manager's report all at the same time
Links tables togetherChange a price once, not in 50 places

SQL: the language of databases

You talk to the database in SQL (say "S-Q-L" or "sequel"). It reads almost like English:

SELECT name, price
FROM menu_items
WHERE vegetarian = true
ORDER BY price;

SQL has been around since the 1970s and is used by nearly every database — PostgreSQL, MySQL, SQL Server, Oracle, SQLite. Learn it once, use it everywhere.

Why PostgreSQL?

  • Free and open source — no licence to buy, for any use
  • Popular — in recent Stack Overflow developer surveys it's been the most-used database among developers
  • Trusted — known for keeping data safe and following the SQL standard closely
  • Used by many cloud services you may meet later, like Supabase and Neon

The Corner Café database

All through the course you'll work with the sales records of Corner Café, a made-up neighbourhood café, for March 2026:

TableWhat's in it
categoriesCoffee, Tea, Drinks, Food
menu_items15 items, with prices
staff6 people who work there
customers25 loyalty-card members
orders1,492 orders: when, who served, who bought (if a member), card or cash
order_itemsWhat was in each order, and how many

Try it

Download the starter files and unzip them. Open cafe.sql in any text editor (Notepad, TextEdit or VS Code) and have a look — it's just SQL that builds the tables and fills them in. By the end of the course you'll understand every line.

Downloads

1 file to download once you enrol.