Skip to content
Part IA Michaelmas Term

Fields, Records, and Data Representation

From punched cards to key-value stores

Fixed-field records were the earliest digital data format, inherited from punched cards. Each field occupies a predetermined range of character positions on a line. This is efficient for machines to parse but inflexible: changing a field width requires rewriting every record.

Comma/character-separated value (CSV) records use delimiters to separate fields. This is more flexible than fixed-width, but still imposes a simple row-and-column structure and struggles with embedded delimiters or line breaks within field values.

The in-core associative store

The simplest possible database is an in-core associative store — a dictionary (or collection) held in primary memory with just two operations:

store(key, value)
retrieve(key)

There are no constraints on the order of invocations. The associative store can be implemented with a hash table, balanced tree, or any other dictionary data structure. It is ephemeral (lost when the process exits) and limited by the size of RAM.

Database terminology

Students are expected to understand all of the following glossary terms by the midpoint and endpoint of the course:

TermDefinition
ValueAn individual piece of data: a character string, number, date, or even a polygon in a spatial database
Field (attribute, column)A named category of values; e.g., surname, date_of_birth
Record (row, tuple)A sequence of fields that together describe one entity
SchemaA specification of how data is arranged: table names, field names, data types, and consistency rules
KeyA field (or concatenation of fields) used to uniquely locate a record
IndexA derived data structure that provides fast lookup of records by non-key fields
QueryA retrieve or lookup operation expressed in a query language
UpdateA modification to the stored data
TransactionAn atomic unit of change to the database with ACID properties

Schemas

A schema defines the shape of the data:

Table: Students
  Name:     string, not null
  CRSID:    string, not null, primary key
  College:  string
  Year:     integer, range [1, 4]

The schema is enforced by the DBMS. Any insert or update that violates a constraint is rejected. This is in contrast to schema-free systems (e.g., document databases), where the application must enforce its own consistency.

Summary

  • Data can be represented as fixed-field records, delimited records, or in-core dictionaries.
  • The core vocabulary of databases — field, record, schema, key, index, query, update, transaction — underpins everything that follows in the course.
  • A schema is a contract: the DBMS guarantees that all data conforms to it.