Unit 11.2A · Term 2

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.

Store data

Keep large amounts of structured information in an organised form.

Find data

Locate required records instead of manually searching unstructured files.

Update data

Change stored information when real-world information changes.

Organise related data

Keep connected information in related tables instead of one huge repeated list.

A school stores 1,200 students, 45 classes and teacher information. Why is a database more suitable than a collection of unrelated notes?
Choose the best answer.

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 → 11A
Arman → 11A
Dana → 11B
↔

CLASSES

11A → Ms Brown
11B → 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
Choose a class code to see how rows in separate tables contain connected information.

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 Email
S001 Ali 11A ali@nis.edu.kz
S002 Dana 11B dana@nis.edu.kz
S003 Arman 11A arman@nis.edu.kz
Use the buttons to highlight each database structure.

Quick Terminology Check

In the STUDENTS table, what database term describes Email?
Choose the correct term.

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

Ali→ S001
Arman→ S003
Dana→ S002
Madi→ S004

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

Choose a search method.

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

Table name: —
Attributes: —
Record values: —
Select an item, then choose its category.

Database Vocabulary Lab

Choose the best term.

Common Misconceptions

Attribute ≠ record

An attribute is one named column. A record is the complete set of stored values in one row.

Index ≠ ID

An ID may be stored as an attribute. An index is a separate search structure.

Record ≠ one cell

One cell is a single value. A record includes all attribute values for one entry.

Relational ≠ just “a spreadsheet”

The defining idea is organised tables containing related data, not simply rows and columns on one sheet.

Worked Examples
Choose an example:

Graded Tasks
Remember

Define the term relational database.

Remember

State two purposes of a database.

Understand

In a STUDENTS table containing StudentID, Name, Class and Email, identify the table and list its four attributes.

Understand

Explain what is meant by a record using the STUDENTS table as an example.

Apply

A library table stores BookID, Title, Author and Year. Write one possible complete record and identify its attributes.

Apply

Explain how an index on Name can help a database locate a student record more quickly.

Analyze

Compare storing class tutor information repeatedly in one large STUDENTS table with storing it once in a separate CLASSES table.

Create

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

Eight quick checksOpen each answer to reveal
1. What is a relational database?
Reveal answer

A database that organises related data into tables that can contain connected information

2. What is a table?
Reveal answer

A collection of related records organised into rows and columns

3. What is an attribute?
Reveal answer

A named column or characteristic stored for the records in a table

4. What is a record?
Reveal answer

One complete row containing the stored values for one entry

5. What is the purpose of an index?
Reveal answer

To help the database locate matching records more quickly

6. Is an index the same thing as an ID attribute?
Reveal answer

No — an ID is stored data in a table; an index is a separate search structure

7. Give two purposes of a database.
Reveal answer

For example: structured storage, searching for records, updating data, and organising related information

8. Why can related tables be better than repeatedly storing all information in one large table?
Reveal answer

They organise connected information separately and can reduce unnecessary repetition of the same data