Relational Databases
A relational database stores related data in tables. Each table contains named attributes (columns) and records (rows). Related tables allow connected information to be organised and managed efficiently.
Learning Objectives
- 11.4.1.1 Describe relational databases and their purpose
- 11.4.1.2 Use the terms "table", "attribute", "record", and "index" to describe databases
Database & Relational Database
Craig'n'Dave — introduction to databases, flat files and relational databases.
Terminology note
This course uses the term attribute. Some textbooks and videos use field for a similar column-level concept. In answers for this lesson, use the syllabus term attribute.
Conceptual Anchor
The Spreadsheet Evolved
Imagine a spreadsheet where each sheet is a table, each row is a record, and each column is an attribute. Now imagine that the sheets contain connected information and can be related to one another. That is the basic idea of a relational database.
What Is the Purpose of a Database?
A school may need to manage thousands of students, classes, teachers and results. A database gives the organisation a structured way to store, find, update and connect that information.
Keep large amounts of structured information in an organised form.
Locate required records instead of manually searching unstructured files.
Change stored information when real-world information changes.
Keep connected information in related tables instead of one huge repeated list.
Why Relational?
One large table
| Name | Class | Tutor |
|---|---|---|
| Ali | 11A | Ms Brown |
| Arman | 11A | Ms Brown |
| Dana | 11B | Mr Green |
Class information is repeated every time a student belongs to that class.
Related tables
STUDENTS
Ali → 11AArman → 11ADana → 11B
CLASSES
11A → Ms Brown11B → Mr Green
Related information is organised in separate tables and connected through shared data values.
Scope of this lesson
The next database lessons will explain exactly how table relationships and keys are defined. Today the important idea is simpler: a relational database stores connected data in related tables.
Relational Database Explorer
STUDENTS
| Name | ClassCode |
|---|---|
| Ali | 11A |
| Arman | 11A |
| Dana | 11B |
CLASSES
| ClassCode | Tutor |
|---|---|
| 11A | Ms Brown |
| 11B | Mr Green |
Table Anatomy
TABLEWhole organised structure
A collection of related records stored in rows and columns.
ATTRIBUTENamed column
A characteristic stored for every record, such as Name or Email.
RECORDComplete row
All the stored values for one person, object or item.
INDEXSearch structure
A separate database structure that helps locate records more quickly.
| StudentID | Name | Class | |
|---|---|---|---|
| S001 | Ali | 11A | ali@nis.edu.kz |
| S002 | Dana | 11B | dana@nis.edu.kz |
| S003 | Arman | 11A | arman@nis.edu.kz |
Quick Terminology Check
Email?What Is an Index?
Book Index Analogy
A book index does not replace the pages of the book. It gives you a faster route to the page you need. A database index works in a similar way: it stores search information that helps the DBMS locate records without checking every record one by one.
Example index on Name
Important
Index ≠ ID column and Index ≠ row number. An index is a separate database structure used to speed up locating records.
Index Search Simulator
This is a simplified model: the index maps each name to a record ID. Real database indexes use specialised structures; the steps and timings here do not measure database performance. Indexes take storage space and can slow down inserts, updates and deletes because the index must also be maintained.
STUDENTS records
INDEX on Name
Build a Table
Click each item and decide whether it is a table name, an attribute, or a value that belongs inside a record.
Classification
Database Vocabulary Lab
Common Misconceptions
An attribute is one named column. A record is the complete set of stored values in one row.
An ID may be stored as an attribute. An index is a separate search structure.
One cell is a single value. A record includes all attribute values for one entry.
The defining idea is organised tables containing related data, not simply rows and columns on one sheet.
Worked Examples
Graded Tasks
Define the term relational database.
State two purposes of a database.
In a STUDENTS table containing StudentID, Name, Class and Email, identify the table and list its four attributes.
Explain what is meant by a record using the STUDENTS table as an example.
A library table stores BookID, Title, Author and Year. Write one possible complete record and identify its attributes.
Explain how an index on Name can help a database locate a student record
more quickly.
Compare storing class tutor information repeatedly in one large STUDENTS table with storing it once in a separate CLASSES table.
Design two small related tables for a school club system. Name the tables, list suitable attributes and provide two example records. Do not use SQL.
Exam Practice
Q1: A database contains a table called STUDENTS. StudentID, Name, Class and Email are stored for each student. An index has been created on Name. Using database terminology, describe the structure and explain the purpose of the index. [5]
Reveal marking points
- STUDENTS is the table. [1]
- StudentID, Name, Class and Email are attributes. [1]
- Each student’s complete row is a record. [1]
- The index is a separate search structure on Name. [1]
- It helps locate matching records without checking every record sequentially. [1]
Q2: Explain one purpose of using related tables in a relational database. [2]
Reveal marking points
- Related information is organised in separate tables. [1]
- This reduces unnecessary repetition and helps keep updates consistent. [1]
Q3: State whether each item is a table, attribute or record.
[3]
(a) Email (b) all data stored about Dana (c)
STUDENTS
Reveal marking points
- (a) Email: attribute. [1]
- (b) All data stored about Dana: record. [1]
- (c) STUDENTS: table. [1]
Q4: Explain why an index is not the same thing as a StudentID attribute. [2]
Reveal marking points
- StudentID is an attribute containing stored data. [1]
- An index is a separate structure that helps locate records more quickly. [1]
Self-Check Quiz
Reveal answer
A database that organises related data into tables that can contain connected information
Reveal answer
A collection of related records organised into rows and columns
Reveal answer
A named column or characteristic stored for the records in a table
Reveal answer
One complete row containing the stored values for one entry
Reveal answer
To help the database locate matching records more quickly
Reveal answer
No — an ID is stored data in a table; an index is a separate search structure
Reveal answer
For example: structured storage, searching for records, updating data, and organising related information
Reveal answer
They organise connected information separately and can reduce unnecessary repetition of the same data