Introduction to Databases
Meaning and Reason for Databases; Parts of a Database; Keys, Relationships and Design; Using a Database Program; Advantages and Precautions
On this page8 sections
- 01Learning Objectives
- 02Meaning and Reason for Databases
- 03Parts of a Database
- 04Keys, Relationships and Design
- 05Using a Database Program
- 06Advantages and Precautions
- 07Practical Work
- 08Scenario-Based Questions
Learning Objectives
- Define a database and state why databases are used.
- Describe the parts of a database.
- Distinguish between a table, a record and a field.
- Create, sort and filter a table in a database program.
Meaning and Reason for Databases
A database is an organised collection of related data stored so that it can be searched, sorted and retrieved quickly. A file system stores data in separate files, which leads to duplication and to data that disagrees with itself. A database stores the data once in a controlled structure.
A school keeps a register of pupils. In files, each pupil would have a separate file, and a change of address would have to be made in several places. In a database there is one pupil record, so the change is made once and every report that uses it is correct.
A database is used when there is a large amount of related data that must be searched quickly or reported on in different ways. Schools, banks, hospitals, shops and government offices all use databases.
Parts of a Database
A database system has three parts. The database itself is the collection of stored data. Database software is the application used to enter, search and report on the data. The hardware is the machine and the storage that holds it.
Within the database, data is held in tables. A table holds one kind of record, such as all the pupils or all the staff. A record is one row and holds the fields of one item. A field is one column and holds one kind of information about every record, such as the surname of every pupil.
Each table has a key. The primary key is the field or combination of fields that makes every record unique, and no two records may share the same key. A pupil number makes a good primary key because it is unique and does not change, while a name does not, because two pupils may have the same name.
A table and a record are not the same. A table holds many records, and a record is one row.
A field is not a column label only. The label is the field name, while the field holds the value in each row.
A primary key must be unique, so a name is a poor choice because two people may share it.
Keys, Relationships and Design
A foreign key is a field in one table that refers to the primary key of another table, and the link is called a relationship. A pupil table holds the name and address, an marks table holds the scores, and the pupil number links them.
The design is called normalisation. Splitting the data so that each fact is stored once avoids repetition. The pupil table holds the address once and the marks table holds the scores, and neither repeats the other. This is called first normal form, and the goal is that a fact is entered once and used everywhere.
A relationship may be one to one, where each record in the first table matches exactly one in the second, or one to many, where one record matches many in the second. One pupil has many results, so that is a one to many relationship.
Validation means checking data as it is entered.
Redundancy means the same fact stored more than once.
Using a Database Program
A database program is used to create a table, define the fields and their data types, and then enter the records. The data type is set for each field, such as text, number or date, and it decides what may be entered.
Records are sorted by choosing a field and the sort order, which arranges the records alphabetically or by value. Filtering shows only the records that meet a stated condition, such as all the pupils in a given class, while the rest are hidden but not deleted.
A search finds a particular value. A report is a formatted output produced from the data, such as a list of pupils in a class or a record of attendance. Reports are generated from the stored data, so they are up to date without being typed.
Filtering hides records without deleting them, so a filtered result is not a reduced database.
Advantages and Precautions
The advantages of a database are that data is stored once, searches are fast, several users may work with the same data at once, security can control who sees what, and reports can be produced in any required format.
Precautions are needed because a database holds a great deal in one place. Access is given only to those who need it, a password protects it, a backup copy is kept separately, and the data is validated on entry so that a date of birth cannot be entered as a word.
| Component | Meaning |
|---|---|
| Database | The organised collection of stored data |
| Database software | The application used to enter, search and report |
| Hardware | The machine and storage that hold the database |
| Table | A collection of records of one kind |
| Record | One row holding the fields of one item |
| Field | One column holding one kind of information |
| Primary key | The field that makes every record unique |
| Foreign key | A field that refers to the primary key of another table |
| Relationship | The link between two tables |
| Data type | The kind of value a field accepts |
| Validation | Checking the data as it is entered |
| Sort | Arranging records in a chosen order |
| Filter | Showing only the records that meet a condition |
| Report | A formatted output produced from the data |
| Relationship | Meaning | Example |
|---|---|---|
| One to one | Each record matches exactly one in the other table | A pupil and a single admission record |
| One to many | One record matches many in the other table | One pupil and many results |
| Many to many | Many records match many in the other table | Pupils and subjects |
Practical Work
- Create a database with one table of pupils holding the fields pupil number, surname, forename, class and date of birth.
- Set the data type of each field and set the pupil number as the primary key.
- Enter ten records, then sort the table by surname and confirm the order.
- Use a filter to show only the pupils in a given class and record the number shown.
- Create a second table of results holding the pupil number and three scores, and link it to the first table using the pupil number.
- Produce a report listing the pupils in one class with their scores.
Scenario-Based Questions
- Explain why storing pupil records in separate files leads to errors that a database avoids.
- A school wants to use names as the primary key of a pupil table. Give two reasons this is a poor choice.
- Explain the difference between a field and a record, using a library catalogue as an example.
- Describe how splitting the address from the marks table reduces redundancy.
- Explain what a filter does and state what it does not do.
- A database holds confidential results. Explain two precautions that should be applied.
- Explain the difference between a one to many relationship and a many to many relationship.
LEARNING OBJECTIVES: BY THE END OF THE LESSON STUDENTS SHOULD BE ABLE TO:
| Cognitive | i. Define a database and state why databases are used. ii. Describe the parts of a database. iii. Distinguish between a table, a record and a field. iv. Create, sort and filter a table in a database program. |
| Affective | i. Appreciate the value of Introduction to Databases in school, at home and in the community. ii. Show willingness to use digital tools carefully, safely and responsibly. |
| Psychomotor | i. Create a database with one table of pupils holding the fields pupil number, surname, forename, class and date of birth. ii. Set the data type of each field and set the pupil number as the primary key. iii. Enter ten records, then sort the table by surname and confirm the order. iv. Use a filter to show only the pupils in a given class and record the number shown. |
Rationale: A database is an organised collection of related data stored so that it can be searched, sorted and retrieved quickly. Understanding meaning and Reason for Databases, parts of a Database, keys, Relationships and Design, using a Database Program helps learners use digital technology confidently, safely and responsibly.
Pre-requisite Knowledge: In Week 8, learners studied The Internet and Online Safety, including what the Internet Is, how Data Travels, services on the Internet. The knowledge from that week is used again in this lesson.
Learning Material/Teaching Aid: Whiteboard, markers, computer or laptop where available, printed notes and charts on Introduction to Databases, practical task sheets, learners' notebooks and pens.
Reference Materials: Digital Technology for Senior Secondary Schools (SS 2); NERDC Digital Technology Curriculum; Digital Technology SS 2 First Term Notes (Week 9); First Term examination and Continuous Assessment question papers.
LESSON DEVELOPMENT
| Stage/Step (Time) | Teacher's Activities | Student's Activities | Learning Points |
|---|---|---|---|
| Introduction 5 MINUTES | Welcomes learners, revises Week 8 (The Internet and Online Safety) with two quick oral questions, and asks what they already know about Introduction to Databases. Elicits responses and writes the topic on the board. | Recall the previous lesson and share what they already know about Introduction to Databases. | Connecting prior knowledge to Introduction to Databases. |
| Step 1 6 MINUTES | Covers Meaning and Reason for Databases: A database is an organised collection of related data stored so that it can be searched, sorted and retrieved quickly. A file system stores data in separate files, which leads to duplication and to data that disagrees with itself. Covers Parts of a Database: A database system has three parts. The database itself is the collection of stored data. | Listen, take notes and answer oral questions on "Meaning and Reason for Databases" and related points. | Understanding: Meaning and Reason for Databases; Parts of a Database. |
| Step 2 6 MINUTES | Covers Keys, Relationships and Design: A foreign key is a field in one table that refers to the primary key of another table, and the link is called a relationship. A pupil table holds the name and address, an marks table holds the scores, and the pupil number links them. | Copy the key points, give examples from school and everyday life, and ask questions on "Keys, Relationships and Design". | Understanding: Keys, Relationships and Design. |
| Step 3 6 MINUTES | Covers Using a Database Program: A database program is used to create a table, define the fields and their data types, and then enter the records. The data type is set for each field, such as text, number or date, and it decides what may be entered. | Discuss in pairs, then report one point on "Using a Database Program" to the class. | Understanding: Using a Database Program. |
| Step 4 6 MINUTES | Covers Advantages and Precautions: The advantages of a database are that data is stored once, searches are fast, several users may work with the same data at once, security can control who sees what, and reports can be produced in any required format. | Respond to questions, complete the examples on the board and note down "Advantages and Precautions". | Understanding: Advantages and Precautions. |
| Practical Work 6 MINUTES | Guides learners through the practical work: (i) Create a database with one table of pupils holding the fields pupil number, surname, forename, class and date of birth. (ii) Set the data type of each field and set the pupil number as the primary key. (iii) Enter ten records, then sort the table by surname and confirm the order. Moves round the class to check progress and correct unsafe or careless use. | Carry out the practical tasks individually or in pairs and record what they did in their notebooks. | Applying the lesson through hands-on practice. |
| Evaluation 3 MINUTES | Asks learners to: i. Define a database and state why databases are used. ii. Describe the parts of a database. iii. Distinguish between a table, a record and a field. iv. Create, sort and filter a table in a database program. | Respond verbally and in writing to the evaluation questions. | Assessment and consolidation of the lesson content. |
| Conclusion 2 MINUTES | Recaps the main points: meaning and Reason for Databases, parts of a Database, keys, Relationships and Design, using a Database Program, advantages and Precautions. Links them to the assignment and previews Week 10: Advanced Productivity Tools. | Listen, ask questions and copy the assignment. | Reinforcement of key concepts and a preview of the next lesson. |
Assignment: i. Explain why storing pupil records in separate files leads to errors that a database avoids. ii. A school wants to use names as the primary key of a pupil table. Give two reasons this is a poor choice.
On this page9 sections
- 01Lesson objectives
- 02Key vocabulary
- 03Common misconceptions
- 04Teacher activities
- 05Student activities
- 06Practical / learning evidence
- 07Resources and preparation
- 08Assessment for learning
- 09Inclusion and homework
Lesson objectives
By the end of the week, learners should be able to:
- Define a database and describe its purpose in an organisation.
- Name the main components of a database schema.
- Distinguish relational and non-relational structures briefly.
- Create a simple table schema with fields, types and constraints.
- Explain why indexing speeds up queries.
Key vocabulary
- Database: a structured collection of related records.
- Schema: the design defining tables, fields and relationships.
- Table: a collection of related rows and fields.
- Field: a column holding a characteristic of each record.
- Constraint: a rule limiting what data may enter a field.
- Index: a sorted lookup structure speeding query searches.
- Query: a request returning records matching criteria.
- Relational: a tabular structure holding tables linked by keys.
- Non-relational: a document or graph structure storing loose data.
- Speeds up: makes something faster through a structural aid.
Common misconceptions
- "A database is just a big spreadsheet." Databases enforce constraints and relationships that spreadsheets ignore.
- "Tables store unrelated rows." Related rows belong together because of shared field types.
- "Indexing adds unrelated overhead." Indexing speeds queries substantially without changing stored values.
Teacher activities
- Starter: ask where a school keeps student records if not on a teacher's desktop.
- Define a database and describe its organisational purpose.
- Name the main schema components one by one.
- Briefly distinguish relational from non-relational structures.
- Create a simple table schema on the board for a student records table.
- Demonstrate how an index speeds a query lookup.
Student activities
- Answer the starter and identify the right storage location.
- Define a database in their own words and state its purpose.
- Name the main schema components in one sentence each.
- Distinguish relational from non-relational structures briefly.
- Create a simple table schema with fields, types and constraints.
- Explain why an index speeds up queries in one paragraph.
- Answer the exit question in one sentence about databases versus spreadsheets.
Practical / learning evidence
A one-table schema worksheet with fields, types and constraints, plus an index explanation paragraph. Submit both for marking.
Resources and preparation
Printed schema templates, sample student data and index example cards. Offline route: paper templates, no device needed. Provide an index example drawn simply on paper.
Assessment for learning
Inspect the schema for correct field names, types and at least one constraint. Mark the index explanation for a plausible lookup analogy. Flag any learner who calls the database a big spreadsheet.
Inclusion and homework
Provide the schema prefilled for the field names and allow oral constraint completion. Extend confident learners with two tables linked by a foreign key and a second index example. Homework: name one advantage and one disadvantage of a relational database over a spreadsheet.