Menu

A database is an organised collection of data, stored in a structure that lets a computer find and retrieve information quickly. The structure is the important part: instead of keeping information in a pile of separate documents, everything is held in a fixed format that lets the computer locate the data you want.

Tables hold one type of thing

Data in a database is kept in tables. Each table stores data about one type of thing. A community garden might keep one table holding data about its beehives, and a separate table holding data about the gardeners who look after them, because a hive and a gardener are different types of thing. The table below is one table with four fields and three records.

HiveIDColourQueenAgeJarsHarvested
H1Blue234
H2Green112
H3Blue451

Records and fields

Each row in the table is a record, which brings together every piece of data held about one item. The row H1, Blue, 2, 34 is one complete record, holding everything known about that single hive. A record is always a whole row, never just one value taken from it.

Each column is a field: one particular piece of information that is stored for every record. Every field has a name, such as Colour or JarsHarvested, which labels the column. So a field is a whole column and a record is a whole row, and the two are not the same thing.

Because every record stores exactly the same fields in the same order, the data lines up neatly. A search can go straight to the field it cares about, which is why storing data in tables makes searching so efficient.

Practise this