Tutorial 1 of 8 · Databases and SQL · Asking questions · Beginner
What a database is
Keep data in tables of rows and columns, find any row by its key, and see why a file or a dictionary stops being enough.
5 lessons, the last is a challenge · about 1 h · SQL
Before you start
You finished "Nested data": you can keep a table as a list of rows, and you have met a list of dictionaries, one dictionary for each student.
You can write a loop with an if inside it, in Python or in Java. Lesson 2 compares one such loop with a database; the rest of the tutorial needs no Python or Java.
1Read a table: say what a row and a column are, read one row by eye, and follow a number from one table to the row it names in another.
2Say why a database beats a list or a file for data that must last and be shared: it keeps the data when your program stops, lets several programs use it at once, refuses bad rows and finds a row by its key.
3Say what a primary key is, pick a column that could be one, and predict what happens when a new row repeats a key.
4Write and run a first query with SELECT, FROM and WHERE, and predict the rows it gives back.