How does a Leeds library know which book you want and how many copies it has?
You find the book you want in a Leeds library catalogue. It says the library has three copies. How does the catalogue keep that count with the right book when it holds thousands of titles?
Think back to records in programming. At the top is one book record. Below it are two details: the title is River Walks and the number of copies is three. The record keeps those details together.
A database is an organised collection of data. This Books table is part of the library's database. Read across the first row: book zero zero four seven is River Walks and has three copies. That's one record. Read down instead: each column is a field, such as Title or Copies.
You want every detail the table stores about City Birds. Which part of the table would you read to get its book identifier, title and copy count together? Pick one answer.
A schema describes a table's structure, including each field's data type. Look at the title River Walks. It's text, so use a string. Now look at the copy count, three. It's a whole number, so use an integer.
Choose a type for each field. The book identifier must stay as zero zero four seven, so use a string to keep both leading zeroes. The title River Walks is text, so use a string again. Three copies is a whole number, so use an integer.
A different book has the identifier zero zero eight two, and the library holds six copies. You need to keep the identifier exactly as printed and add up copy counts. Which types would you choose? Pick one answer.
It's easy to see digits and pick integer. Look at zero zero eight two on the left. As an integer its value is eighty-two, so the stored number doesn't remember those zeroes. On the right, the string keeps all four characters in order.
A relational database uses tables that can be linked by matching values. Each primary key uniquely identifies a record in its table. Publisher ID in Books is a foreign key: P zero one links to the matching publisher record. Store the address there once so a missed update cannot leave conflicting copies.
If asked to describe a book record, name the fields for one book. If asked to explain why Book ID is a string, say that text keeps the leading zeroes. To explain how linking reduces repeated data, say where the address is stored and how each book finds it.