8.1.2 Tables, Records and Attributes
A relational database represents real-world data using structured tables. This lesson develops the vocabulary needed to describe those tables precisely before keys, relationships and referential integrity are studied in the next section.
By the end of this section, you should be able to:
- Distinguish between an entity and an individual instance of that entity.
- Identify a relation, tuple, attribute and attribute value in a relational table.
- Connect the formal terms tuple and attribute with the common terms record and field.
- Explain why each cell should normally contain one atomic value.
- Interpret and write a simple table definition using relational notation.
From Real-World Objects to Relational Tables
A database begins with the things, people, events or transactions that an organisation needs to describe. In database design, one category of real-world object is called an entity. Data about that entity can then be organised into a table.
Consider a robotics competition. The organisers need to store data about every robot entered in the event. Robot is an entity because the system will store multiple robots that share the same kinds of data.
Relational database: a collection of relations used to store connected data.
Entities and Entity Instances
An entity is the general category. An entity instance is one particular example of that category. Each instance normally becomes one row in the table.
| Entity | Possible instance | Data that might describe it |
|---|---|---|
| Robot | Robot R-204 | Name, mass, inspection date and readiness status |
| Team | Team T-17 | Team name, school and coach |
| Match | Match M-083 | Round, start time and arena |
The Anatomy of a Relational Table
The relation below stores one tuple for each robot. The headings describe the same properties for every tuple, while each body cell contains an attribute value.
| RobotID | RobotName | MassKg | InspectionDate | Ready |
|---|---|---|---|---|
| R-204 | Aster | 11.8 | 2027-09-12 | TRUE |
| R-219 | Orbit | 9.6 | 2027-09-13 | FALSE |
| R-231 | Mosaic | 12.4 | 2027-09-13 | TRUE |
| Table part | Database meaning | Example above |
|---|---|---|
| Whole table | One relation representing an entity | Robot |
| One column | One attribute shared by every instance | MassKg |
| One row | One tuple describing one instance | The row for R-219 |
| One cell | One attribute value for one instance | 9.6 |
Formal and Common Terminology
Database questions may use formal relational terminology or more familiar terms. Students should recognise both and use them accurately.
| Formal term | Common term | Meaning |
|---|---|---|
| Relation | Table | The complete two-dimensional structure for one entity. |
| Tuple | Record | One row containing data about one entity instance. |
| Attribute | Field or column | One named property recorded for every tuple. |
| Attribute value | Field value | The value stored where one tuple and one attribute meet. |
Record: the common term for a tuple.
Attribute: a named property represented by a column.
Field: a common term often used for an attribute or for the value stored in it, depending on context.
One Cell, One Atomic Value
A well-formed relational table normally stores one atomic value in each cell. Atomic means that the value is treated as one indivisible item for the purpose of the database design.
| Example entry | Atomic? | Reason |
|---|---|---|
| RobotName = Aster | Yes | The cell contains one robot name. |
| InspectionDate = 2027-09-12 | Yes | The date is treated as one value. |
| SensorTypes = infrared, ultrasonic | No | The cell contains a list of two separate sensor types. |
| CoachEmails = [email protected]; [email protected] | No | Two separate email values have been packed into one cell. |
Lists inside a cell are difficult to search, validate and update consistently. A later design stage may place repeated values in another related table instead.
Writing a Table Definition
A compact table definition places the relation name first and lists its attributes inside brackets:
This notation describes the logical structure rather than the current data. It tells us which attributes exist, but it does not list the robot tuples stored at a particular moment.
| Part of the notation | Meaning |
|---|---|
| Robot | The relation name |
| RobotID, RobotName, ... | The attribute names |
| The brackets | The boundary of the attribute list |
The order in which rows are displayed is not part of their meaning. Similarly, changing the visible order of columns does not change which attributes belong to the relation. A query can choose and order the output when data are retrieved.
Interactive: Table Anatomy Explorer
Select a concept to highlight the matching part of the Robot relation. The final mode checks whether example cells contain one atomic value.
Common Mistakes and Misconceptions
- Calling one robot an entity instead of an entity instance.
- Reversing tuple and attribute: a tuple is a row; an attribute is a column.
- Using record and field without stating whether a row, column or individual value is meant.
- Thinking a relation is simply any table drawn in a document.
- Assuming that a cell containing a comma-separated list still stores one atomic value.
- Confusing the table definition with the tuples currently stored in the table.
Practice
Try these original questions
- Define entity and give one possible instance of the entity Vehicle.
- Explain the difference between a relation and a tuple.
- State the formal database terms for a record and a field represented as a column.
- In Sensor(SensorCode, Location, ReadingUnit, Active), identify the relation and its attributes.
- A row stores: S-44, Greenhouse 2, °C, TRUE. Explain what this row represents.
- Explain why
ContactNumbers = 186..., 139...is not an atomic value. - Rewrite the following as relational notation: a table called Delivery with the fields DeliveryNo, DateSent, Destination and Delivered.
- Explain why reordering the displayed tuples does not change the logical meaning of a relation.
Review
| Term | Meaning | Example from Robot |
|---|---|---|
| Entity | A category of thing about which data are stored | Robot |
| Relation / table | The complete structured table for the entity | The Robot table |
| Tuple / record | One row for one entity instance | The row beginning R-219 |
| Attribute / field | A named property represented by a column | MassKg |
| Attribute value | One stored value for one tuple and attribute | 9.6 |
| Atomic value | One indivisible value for the chosen design | 2027-09-13 |