Codele / How software is built
Databases and tables
Values in variables vanish when a program stops. A database keeps them safe in tables. Watch customers stay, then add one, change one and find one.
- Variables vanish when a program stops. A database keeps data safe on disk.
- A table has columns (one fact each) and rows (one thing each).
- The primary key is a column, usually id, with a different value in every row.
- INSERT adds a row, UPDATE changes cells, SELECT reads rows. Always say which rows with WHERE.
- Find rows by their id. Names can repeat, but a primary key never does.
Loading the playable lesson…