The big idea
A database is an organised store of data that a computer can search and change quickly. Your school's timetable, a music app's playlists and a shop's stock list all live in databases.
Most databases are relational databases. They keep data in tables, a bit like spreadsheets, and the tables can be linked together. To talk to them you use SQL (Structured Query Language, said "S-Q-L" or "sequel"). SQL is a declarative language: you describe what you want ("the titles of all mystery books") and the database decides how to find it. That is very different from Python, where you write every step yourself.
In this course you use SQLite, a small, free database engine that keeps a whole database in a single file. It is built into Android and iOS phones, the major web browsers and Python, so it is one of the most widely used pieces of software in the world. The SQL you learn here works, with small changes, in bigger systems such as PostgreSQL, MySQL and SQL Server.
Explained simply
Think of the school library. Every book has a title, an author, a genre, a year and a number of pages. In a database those books sit in a table called books:
- A row (also called a record) holds everything about one book.
- A column (also called a field) holds one fact, such as
year, for every book. - Each column has a data type, which says what kind of value it holds.