MyLeoNes™

Databases and queries — Technology, 14–17 years

Learn how organised data can be stored, found and updated without searching every item by hand.

A database is organised memory

A database stores related facts in a structure that a computer can search and change. A school might keep one row for each pupil, with columns for a name, year and attendance. A query asks for just the records matching a condition, such as pupils absent more than five times.

Why databases were needed

Paper files and separate spreadsheets become slow and contradictory when millions of records must be shared. Early organisations needed reliable ways to find one fact, connect related facts and update it once rather than in many places. Databases solve this problem by giving data a common structure and controlled access.

Finding matching records

Suppose a table has Ana, 82; Bruno, 67; and Chiara, 91, where each number is a test score. To find scores of at least 80, the query checks each row against score ≥ 80. Ana matches, Bruno does not, and Chiara matches, so the result is Ana and Chiara.

The trap: data is not automatically tidy

It is tempting to think a database will understand that “London”, “london” and “Lond.” mean the same place. Computers usually compare stored text exactly unless rules say otherwise. This mistake is reasonable because people repair small differences instantly; at large scale, inconsistent data produces missing or duplicated results.

Databases around you

When a streaming service shows your watch history, a shop checks stock or a doctor opens your record, a database is usually involved. It can connect tables, such as customers and orders, so one fact is not copied everywhere. Because these records may be personal, good systems also limit who can view or change them.

Keep exploring

Other languages

Loading MyLeoNes™…