SQL from Zero › Module 1: How a database thinks

What is a database?

Why apps keep their data in databases, and what SQL is for.

Lesson 1 of 33 · about 8 minutes

Video: A library, not a pile of booksThe narrated video for this lesson is coming soon. The lesson below covers the same ideas.

The lesson

Imagine a bookshop that keeps its records in a notebook. Every time someone buys a book, the owner writes it down. That works for ten customers. With ten thousand customers, finding "everything Yuki bought last year" means flipping through hundreds of pages.

A spreadsheet is a better notebook. But spreadsheets start to struggle when lots of people use them at once, when the same information is copied in many places, and when one wrong edit can quietly break everything.

A database is like a well-run library. Every book has a fixed place. There are rules about what can go where. A librarian can find any book in seconds, many people can borrow books at the same time, and nothing gets lost.

SQL (say "sequel" or "S-Q-L") is the language you use to talk to that librarian. You don't tell the librarian how to walk through the shelves. You just say what you want, like "all books by Agatha Christie under $10", and the database works out how to get it.

Almost every app you use, from banking and shopping to food delivery and school portals, has a database behind it.

Key ideas
  • A database stores information in an organised way, with rules, so it stays correct and quick to search.
  • SQL is the language for asking a database questions and giving it instructions.
  • With SQL you describe what you want, not how to find it.

Practise

Loading practice…

Quick check

1. What does SQL let you do?

2. When you write SQL, what do you describe?

3. Which most needs a database?