Lesson Notes By Weeks and Term v3 - Senior Secondary 3

Database

Download the Lessonotes Mobile Nigeria 2025 app for faster lesson access on Android and iPhone.

Subject: Computer & IT

Class: Senior Secondary 3

Term: 3rd Term

Week: 1

Theme: Computer Applications

Lesson Video

This page supports the lesson note with a companion video and a short classroom-ready summary.

For class groups and homework, share this lesson page so learners also get the summary, objectives, and full lesson context.

Performance objectives

Lesson summary

Define database and database package State examples of database packages Define the basic terms in database. State the different for ms of database or ganization Recognize and state the features in a computer database for mat. Create a database carry out basic operations on an existing database.

Lesson notes

through relationships.

Usage: Widely used in almost all modern applications: banking, e-commerce, government, education, etc. (e.g., MySQL, Oracle, MS SQL Server, MS Access).

4. Object-Oriented Database (OODBMS): Structure: Stores data as objects, similar to objects in object-oriented programming. Objects contain both data (attributes) and methods (operations) that act on the data.

Characteristics: Good for handling complex data types like multimedia, spatial data, and CAD/CAM applications. Offers better integration with object-oriented programming languages.

Usage: Niche applications where complex data structures and object behavior are critical.

5. NoSQL Database (Not Only SQL): Structure: A diverse category of databases that do not follow the traditional relational model. They offer flexible schemas and are designed for specific use cases, often involving large volumes of unstructured or semi-structured data.

Types: Key-Value Stores: Data stored as key-value pairs (e.g., Redis).

Document Databases: Store data in flexible, semi-structured documents (e.g., MongoDB, Couchbase).

Column-Family Stores: Store data in columns rather than rows (e.g., Cassandra).

Graph Databases: Store data in nodes and edges, ideal for relationships between data points (e.g., Neo4j).

Characteristics: Highly scalable, flexible schema, good for distributed systems and big data analytics.

Usage: Social media platforms, real-time web applications, big data analytics. 2.

5. Features in a Computer Database Format (Focus on Relational Databases) When working with a typical relational database package like Microsoft Access, the following features are prominent: Tables: The fundamental building blocks, organizing data into rows and columns.

Fields with Data Types: Specific attributes for an entity, each defined by a data type to ensure data consistency.

Records: Complete sets of data for individual entries within a table.

Primary Keys: Unique identifiers for each record, ensuring data integrity.

Foreign Keys and Relationships: Mechanisms to link related tables together, enabling the retrieval of interconnected data.

Queries: Tools for extracting specific data, filtering, sorting, and performing calculations.

Forms: User-friendly interfaces for data entry, editing, and viewing.

Reports: Professional and formatted outputs for presenting summarized data.

Macros/Modules: For automating repetitive tasks or adding advanced functionality (e.g., custom buttons, validation rules).

Data Validation Rules: Rules applied to fields to ensure that data entered meets specific criteria (e.g., a score must be between 0 and 100).

Referential Integrity: A set of rules that the DBMS enforces to ensure that relationships between tables remain consistent, preventing orphaned records.

Security Features: User authentication, role-based access control, and permissions to protect data from unauthorized access or modification.

Indexing: Creating indexes on frequently searched fields to speed up data retrieval. 2.

6. Steps to Create a Database (Illustrative using MS Access) This section provides a general outline; actual steps may vary slightly depending on the specific DBM

S. Step 1: Planning the Database

1. Determine the purpose: What data will be stored? What questions need to be answered?

2. Identify necessary tables: Break down the information into logical entities (e.g., `Students`, `Teachers`, `Subjects`).

3. Define fields for each table: For each table, determine the specific pieces of information (attributes) that need to be stored (e.g., `StudentName`, `AdmissionNo`, `DateOfBirth`).

4. Assign data types: For each field, choose the appropriate data type (Text, Number, Date/Time, etc.).

5. Identify primary keys: Choose a unique identifier for each table.

6. Identify relationships: Determine how tables are related (one-to-one, one-to-many, many-to-many) and identify foreign keys.

Step 2: Creating the Database File

1. Launch the DBMS: Open Microsoft Access (or other chosen DBMS).

2. Select "Blank Database": Choose to create a new, empty database.

3. Specify File Name and Location: Give the database a meaningful name (e.g., `School_Records.accdb`) and choose where to save it.

4. Click "Create": The DBMS creates an empty database file.

Step 3: Creating Tables

1. Go to "Create" tab: In Access, select "Table Design" view.

2. Define Field Names and Data Types: Enter `Field Name` (e.g., `StudentID`, `FirstName`). Select `Data Type` (e.g., AutoNumber, Short Text). Add an optional `Description`.

3. Set Primary Key: Select the field designated as the primary key (e.g., `StudentID`), then click the "Primary Key" button in the toolbar.

4. Save the Table: Give the table a This section provides the comprehensive content required for delivering the lesson, explaining core concepts in detail. 2.

1. Definition of Database and Database Package Database: A database is an organized collection of related information or data, systematically stored and managed electronically. Its primary purpose is to store, retrieve, update, and delete data efficiently and securely. Think of it as a highly structured digital filing cabinet that allows for quick access and manipulation of information.

Example: A school's student record system containing names, admission numbers, grades, addresses, and contact details, all organized for easy access. Database Package (Database Management System - DBMS): A database package, more formally known as a Database Management System (DBMS), is a software application used to create, manage, retrieve, and update data within a database. It acts as an interface between the user (or applications) and the database itself, ensuring data integrity, security, and consistent access.

Function: DBMS allows users to define the structure of the database (schema), add, modify, and delete data, query the database for specific information, and generate reports. It also handles data security, concurrent access by multiple users, and data recovery. 2.

2. Examples of Database Packages There are numerous database packages available, each with its strengths and typical use cases.

Microsoft Access: A desktop relational database management system (RDBMS) included in the Microsoft Office suite. It is popular for small to medium-sized applications, offering both a graphical user interface and powerful development tools.

MySQL: An open-source RDBMS widely used for web applications (part of the LAMP stack: Linux, Apache, MySQL, PHP/Python/Perl). It is robust, scalable, and highly customizable.

Oracle Database: A commercial, enterprise-grade RDBMS, known for its high performance, scalability, and robust security features. It is extensively used in large corporations and critical government systems.

Microsoft SQL Server: Another commercial RDBMS developed by Microsoft, primarily for enterprise-level applications. It integrates well with other Microsoft products and services.

PostgreSQL: A powerful, open-source object-relational database system known for its reliability, feature robustness, and performance. It supports a wide range of data types and functions.

IBM Db2: A family of RDBMS products from IBM, suitable for high-volume transaction processing and data warehousing. dBase and FoxPro: Older, foundational database management systems that were popular in the early days of personal computing. While less common now, they laid the groundwork for modern DBMS. 2.

3. Basic Terms in Database Understanding these terms is fundamental to working with databases, especially relational databases.

Table: The primary storage unit in a relational database. It is a collection of related data organized into rows and columns, similar to a spreadsheet. Each table holds data about a specific entity (e.g., "Students", "Courses", "Products").

Example: A table named `Students` might contain all details about enrolled students.

Field (Column): A specific category of information within a table. Each field represents a single attribute or characteristic of the entity. All entries in a given field have the same data type.

Example: In the `Students` table, fields could be `StudentID`, `FirstName`, `LastName`, `DateOfBirth`, `Gender`, `Class`.

Data Types: The type of data that a field can hold.

Common data types include: Text (Short Text/String): For alphanumeric characters, usually up to 255 characters (e.g., Names, Addresses).

Memo (Long Text): For longer text blocks (e.g., Notes, Descriptions). Number (Integer, Long Integer, Double): For numerical data that can be used in calculations (e.g., Age, Quantity, Scores).

Date/Time: For dates and times (e.g., DateOfBirth, AdmissionDate).

Currency: For monetary values (e.g., SchoolFees, ProductPrice).

Yes/No (Boolean): For true/false or binary data (e.g., IsRegistered, IsActive).

AutoNumber: Automatically generates a unique sequential number for each new record.

OLE Object: For embedding objects like pictures, sound clips, or other files.

Hyperlink: For storing web addresses or file paths.

Attachment: For attaching files to a record.

Record (Row): A complete set of fields for a single entity or item in a table. Each row represents a unique instance of the entity being described by the table.

Example: In the `Students` table, one record would contain all information for a single student: `(001, John, Doe, name (e.g., `School_Records.accdb`) and choose where to save it.

4. Click "Create": The DBMS creates an empty database file.

Step 3: Creating Tables

1. Go to "Create" tab: In Access, select "Table Design" view.

2. Define Field Names and Data Types: Enter `Field Name` (e.g., `StudentID`, `FirstName`). Select `Data Type` (e.g., AutoNumber, Short Text). Add an optional `Description`.

3. Set Primary Key: Select the field designated as the primary key (e.g., `StudentID`), then click the "Primary Key" button in the toolbar.

4. Save the Table: Give the table a meaningful name (e.g., `tblStudents`).

5. Repeat for all necessary tables.

Step 4: Defining Relationships (Optional but Recommended for RDBMS)

1. Go to "Database Tools" tab (in Access) and select "Relationships".

2. Add all relevant tables to the relationships window.

3. Drag and Drop: Drag the primary key from one table to the foreign key in the related table (e.g., drag `StudentID` from `tblStudents` to `EnrolledStudentID` in `tblCoursesEnrolled`).

4. Enforce Referential Integrity: Check the "Enforce Referential Integrity" box to maintain data consistency.

5. Click "Create" and save the relationships. 2.

7. Basic Operations on an Existing Database (Illustrative using MS Access) Assuming a database and at least one table (e.g., `tblStudents`) have been created.

1. Entering (Adding)

New Records: Via Table Datasheet View:

1. Open the desired table (e.g., `tblStudents`) in "Datasheet View".

2. Scroll to the last empty row, marked with an asterisk (``).

3. Type the data into each field for the new record.

4. Move to the next row or close the table; the record is automatically saved.

Via Form:

1. Open a data entry form linked to the table (e.g., `Student Registration Form`).

2. Navigate to a new blank record (usually by clicking a "New Record" button).

3. Enter data into the fields.

4. Save the record (often automatic upon moving to another record or closing the form).

2. Editing (Modifying)

Existing Records: Via Table Datasheet View:

1. Open the desired table in "Datasheet View".

2. Navigate to the specific record and field you want to modify.

3. Type the new data.

4. The changes are saved automatically as you move to another field or record.

Via Form:

1. Open the form linked to the table.

2. Navigate to the record you wish to edit (using navigation buttons like "Next Record", "Previous Record", or search functions).

3. Modify the data in the relevant fields.

4. Changes are typically saved automatically.

3. Deleting Records: Via Table Datasheet View:

1. Open the desired table in "Datasheet View".

2. Select the entire record (row) to be deleted by clicking the row selector on the left.

3. Press the `Delete` key or right-click and choose "Delete Record".

4. Confirm the deletion when prompted.

Via Form:

1. Open the form linked to the table.

2. Navigate to the record to be deleted.

3. Click the "Delete Record" button (often represented by an 'X' icon) in the navigation bar or toolbar.

4. Confirm the deletion when prompted.

4. Filtering and Sorting Records: Filtering: To display only records that meet specific criteria.

1. Open the table or form.

2. Click the down arrow next to a field heading.

3. Select specific values to filter by, or choose "Text Filters", "Number Filters", "Date Filters" to set custom criteria.

Sorting: To arrange records in ascending or descending order based on a specific field.

1. Open the table or form.

2. Click the down arrow next to a field heading.

3. Select "Sort A to Z" (Ascending) or "Sort Z to A" (Descending).

5. Running Queries: * Via Query Design View:

1. Go to "Create" tab and select "Query Design".

2. Add the table(s) you want to query.

3. Drag desired fields to the design grid.

4. Set criteria in the "Criteria" row (e.g., `="SS3"` under the `Class` field, `>70` under `Score`).

5. Click "Run" to view the results.

AutoNumber: Automatically generates a unique sequential number for each new record.

OLE Object: For embedding objects like pictures, sound clips, or other files.

Hyperlink: For storing web addresses or file paths.

Attachment: For attaching files to a record.

Record (Row): A complete set of fields for a single entity or item in a table. Each row represents a unique instance of the entity being described by the table.

Example: In the `Students` table, one record would contain all information for a single student: `(001, John, Doe, 12/05/2007, Male, SS3)`.

Primary Key: A field or a set of fields that uniquely identifies each record in a table. It ensures that no two records in the table are identical and that each record can be accessed unambiguously. A primary key must contain unique values and cannot contain null (empty) values.

Example: `StudentID` in the `Students` table is an ideal primary key.

Foreign Key: A field (or collection of fields) in one table that refers to the primary key in another table. It establishes a link or relationship between two tables, ensuring referential integrity.

Example: If we have a `Courses` table with `CourseID` as its primary key, the `Students` table might have a `CourseEnrolledID` field which is a foreign key referencing `CourseID` in the `Courses` table. This links students to the courses they are taking.

Query: A request for data or information from a database. Queries are used to retrieve, filter, sort, group, and even perform calculations on data from one or more tables.

Example: "Show me all students in SS3 who scored above 70 in Computer Science." Form: A graphical user interface (GUI) used for entering, editing, and viewing data in a database. Forms make data entry user-friendly and can be designed to display specific fields or information from multiple tables.

Example: A `Student Registration Form` that allows administrative staff to easily input new student details.

Report: A structured and formatted presentation of data from a database. Reports are used to summarize, analyze, and display data in a printable format for decision-making or record-keeping.

Example: A `Student Performance Report` showing average scores per class, or a `Payroll Report` for staff. 2.

4. Different Forms of Database Organization Databases can be organized in several ways, each with its own structure and advantages.

1. Hierarchical Database: Structure: Organizes data in a tree-like structure, with parent-child relationships. Each child record has only one parent, but a parent can have multiple children.

Analogy: A family tree where each child has only one parent node above them.

Characteristics: Simple to understand, fast access for one-to-many relationships, but rigid structure makes it difficult to represent complex relationships.

Usage: Largely outdated for general-purpose use, though some older systems (like IBM's IMS) still utilize it.

2. Network Database: Structure: An extension of the hierarchical model, allowing a child record to have multiple parent records (many-to-many relationships). Data is organized in a graph-like structure.

Characteristics: More flexible than hierarchical, better at representing complex relationships, but more complex to design and manage.

Usage: Also largely superseded by relational databases, but some older applications might still use it.

3. Relational Database (RDBMS): Structure: The most common type of database. Data is organized into one or more tables (relations), each with a unique key. Relationships between tables are established through common fields (primary and foreign keys).

Characteristics: Highly flexible, robust, easy to understand and manage, supports complex queries using SQL (Structured Query Language). Data integrity is maintained through relationships.

Usage: Widely used in almost all modern applications: banking, e-commerce, government, education, etc. (e.g., MySQL, Oracle, MS SQL Server, MS Access).

4. Object-Oriented Database (OODBMS): Structure: Stores data as objects, similar to objects in object-oriented programming. Objects contain both data (attributes) and methods (operations) that act on the data.

Characteristics: Good for handling complex data types like multimedia, spatial data, and CAD/CAM applications. Offers better integration with object-oriented programming languages.

Usage: Niche applications where complex data structures and object behavior are critical. *

5. NoSQL

Real-life applications

National Identity Management Commission (NIMC): The NIMC database stores the biographic and biometric data of all Nigerian citizens and legal residents. This database is critical for national planning, security, and identity verification for services like banking, SIM registration, and voting. Understanding database principles helps appreciate the complexity and importance of such national infrastructures.

Banking and Financial Institutions: Every transaction, account balance, customer detail, and loan application in Nigerian banks (e.g., First Bank, UBA, Access Bank) is managed by a sophisticated database system. Students can relate to this through ATM usage, online banking, and mobile money services, all of which rely heavily on fast and secure database operations. This highlights data security and integrity as crucial aspects. Joint Admissions and Matriculation Board (JAMB): JAMB uses extensive databases to manage candidate registrations, examination results, and university admissions. This system processes millions of records annually, demonstrating the power of databases in handling large-scale data processing, querying (e.g., checking admission status), and reporting (e.g., candidate lists for institutions).

Healthcare Management: In Nigerian hospitals and clinics, databases are used to manage patient records (medical history, diagnoses, prescriptions), appointments, doctor schedules, and inventory of drugs. This allows for efficient patient care, avoids medical errors, and aids in public health tracking.

Teacher activity

Evaluation guide

Reference guide