Database components
Learning intentions
You should be able to understand the key database components, including the table component, the field component, the record component, and the key component.
You should be able to explain the purpose of primary keys as unique identifiers for records.
You should be able to describe how data types and validation improve accuracy.
You should be able to recognise common database errors and how they affect integrity.
You should be able to use correct terminology when discussing database systems.
What is a table
A table stores related data about one topic
A good table keeps one kind of information in one place
Tables should be named clearly so users can predict what they contain
Fields
A field is a category of data stored in a table
Fields work best when they store one kind of value only
Most fields also have rules that control what can be entered
Records
A record is one complete set of information about a single item.
In a table, a record appears as a row containing a value in each field
A record should be complete enough to be useful on its own
Primary keys
A primary key is a field used to uniquely identify each record in a table.
Its value is unique for every record, even when other information might be the same
A primary key value cannot be blank because every record must be identifiable.
In many databases, the primary key is a number that increases automatically
Why primary keys matter
Primary keys prevent confusion by making it clear which record is being referred to.
This matters when records look similar
Primary keys also support accurate updates because the database can target one record precisely.
Without a reliable identifier, changes may be applied to the wrong record
In a relational database, primary keys are also used to link data across tables.
Data types
A data type defines what kind of value a field can store.
Common examples include text, number, date, and yes/no
Choosing the correct data type helps prevent incorrect entries, such as letters in a number field.
It also helps the database sort and calculate correctly
Validation rules
Validation rules restrict what can be entered into a field.
They reduce errors by catching problems at the point of entry
A rule might require a value to be present, limit a number to a sensible range, or enforce a consistent format. Good validation improves the quality of the whole database because it prevents bad data from spreading into queries and reports.
Data integrity
Data integrity means the data is accurate, consistent, and trustworthy. It matters because database outputs are only as reliable as the data that was entered.
Integrity is supported by primary keys, validation rules, and consistent formats.
When tables are linked, integrity also depends on links staying correct over time
Common database errors
Duplicate records occur when the same item is entered more than once
Incorrect data types cause problems when sorting, filtering, or calculating. Inconsistent formats reduce usability, such as storing dates in multiple different styles.
Poor naming makes a database harder to understand and increases mistakes during use