Before we give the Library its first order, we must understand its structure well. Remember these three words - they will accompany you throughout your journey.
A table is a single shelf - a collection of data of one kind. In our Library we will use several shelves:
ksiazki - all books,autorzy - the creators of the books,czytelnicy - people enrolled in the Library,kategorie - thematic sections,wypozyczenia - who borrowed which book and when.A row is a single scroll - one entry in a table. One row in
czytelnicy describes one person:| id | imie | nazwisko | miasto | |----|------|----------|--------| | 7 | Hypatia | of Alexandria | Alexandria |
A column is a single field describing all rows. In
czytelnicy we have the columns id, imie, nazwisko, miasto. Each column has its type - e.g. text or number (more on types in the "Table Workshop" location).Every shelf has its register of catalog numbers - a column that uniquely identifies each row. This is the primary key, most often the
id column.Thanks to the primary key:
This is exactly the idea behind my Pinakes - a catalog that gives every scroll a unique number.