0984

Database Concepts

Databases · 5 question types

Exam Frequency Analysis

Past paper frequency (2018 to 2024)

This topic accounts for approximately 4% of your exam marks.

stable
Rare
Stable4%

SQL SELECT queries and database structure (tables, fields, records) appear as 4 to 6 mark questions.

A database is an organised collection of data, stored on secondary storage in a way that lets a program retrieve, update and analyse it efficiently.

The focus here is on single-table databases: just one rectangular table of data with named columns (called ) and one row per real-world item (called ).

Databases vs plain text files

Text files were covered in topic 23. The same data could be stored either way; databases offer several advantages. In a plain text file, each item's fields are simply written on consecutive lines, and one such group of lines is a single record:

A plain text file named Employees.txt in which each item is stored as four consecutive lines (name, department, salary, age); two of these four-line groups are outlined and labelled as a record.
Source: Database by Save My Exams
FeaturePlain text fileDatabase
Data organisationLines of text; the program decides what each line meansNamed fields, rows, and column data types
SearchingRead every line in turn (linear)Indexed lookup; very fast even with millions of records
Concurrent accessAwkward; one writer at a timeBuilt-in support for many users at once
ValidationDone by the program reading the fileValidation rules on each field at the database level
SecurityLimited; depends on the OSPer-user access controls, encrypted at rest, audited
Best forSmall amounts of structured text dataLarge, structured data accessed by many users

For a school's collection of student grades, a database is almost always the right tool. For a small configuration file, a plain text file may be enough.