2.
1 Introduction
In today’s world, managing data effectively is crucial in every organization. This is because data
supports decision-making, planning, and control processes. Data also contributes to strategic,
operational, and tactical activities within an organization. To make data storage, retrieval, and sharing
easier and more efficient, organizations use databases.
A *database* is defined as a structured collection of related data items that are stored and organized
in a way that allows controlled and consistent access.
2.2 Types of Databases
Databases are categorized into manual and electronic (computerised) databases.
Manual Database
A manual database is a physical system for storing information using files and folders. These files are
labeled and arranged in order, often kept in cabinets.
Example:
In a school, admission records for students may be stored manually using folders labeled with student
admission numbers like 201/2014, 202/2014, etc.
As data increases, managing manual databases becomes harder, leading to several challenges:
1. Redundancy – Unnecessary duplication of data across files.
2. Lack of Flexibility – Difficulty in quickly locating a specific file or record.
3. Lack of Integrity – Data may become disorganized or inaccurate.
4. Lack of Data Sharing – Information may not be easily accessible to other users.
Electronic Database
An electronic database uses computers to store, organize, and retrieve data. Files are stored
electronically, making it easier and faster to access information.
Example:
In Microsoft Windows, documents are saved in folders on storage media. The folder acts like a digital
filing system.
Compared to manual databases, electronic databases offer:
- Faster access to data
- Easier storage and retrieval
- Better data sharing and organization
2.3 Database Management Systems (DBMS)
To create and manage electronic databases, software called a Database Management System (DBMS)
is used.
A DBMS is a program that helps users to:
- Enter data into the database
- Search for and retrieve information
- Update or delete data
- Control access to the data
Examples of DBMS software:
- Microsoft Access
- Oracle
- MySQL
- SQL Server
- FoxPro
- OpenOffice Base
- dBaseIV
Benefits of Using a DBMS
A DBMS provides the following advantages:
1. *Authorized Access* – Only permitted users can access or update records.
2. *Editing and Updating* – Users can easily make changes to the data.
3. *Efficient Data Handling* – Quick storage, searching, and retrieval of data.
4. *Sharing Data* – Multiple users can access and share data at the same time.
5. *Data Security and Integrity* – Safeguards are in place to protect data from unauthorized access or
corruption.
6. *Integration* – Allows connection between databases and other software applications.
Common Features of DBMS
DBMS (Database Management System) software typically includes:
- Tables: Store data in rows and columns. Each row = a record; each column = a field.
- Queries: Used to retrieve data using SQL (Structured Query Language).
- Forms: User-friendly graphical interfaces for data entry/view.
- Reports: Professional display of data extracted from databases, formatted for printing.
Database Models
Database models define how data is stored, organized, and accessed.
The five common types are:
1. Hierarchical Model
2. Network Model
3. Relational Model
4. Object-Relational Model
5. Object-Oriented Model
This chapter focuses on the relational model, but briefly explains:
1. Hierarchical Model
- Structure: Tree-like; data is organized in levels.
- Access: To reach lower-level data, one must follow a path from the top/root.
- Example: Root → Level 1 → Level 2.
- Limitation: Only one parent per record, limiting flexibility.
- Status: Considered obsolete in modern DBMS.
*Figure 2.1 shows a simple hierarchy: Root → Path → Level 2 data item*
---
2. Network Mode
- *Structure: Graph-like; allows multiple parents and children.
- Relationship: "Many-to-many".
- Access: Flexible, data can be accessed from any related node.
- Status: Also considered obsolete.
Figure 2.2 shows a network with Canteen connected to Customers, Suppliers, and Transactions.
2.4 Database Models
A database model is a logical structure that determines how data is stored, organized, and managed in
a database management system (DBMS). The most common types of database models include:
1. Hierarchical Model
- Organizes data in a tree-like structure.
- Each child record has only one parent.
- To access data, one must follow a defined path from the top (root) level.
- Limitation: Does not support many-to-many relationships.
- Status: Rarely used in modern DBMS; mostly obsolete.
2. Network Model
- More flexible than the hierarchical model.
- Records can have multiple parents and children.
- Supports many-to-many relationships.
- Uses complex linkages between records.
- Status: Also largely obsolete today.
3. Relational Model (Most Common in MSCE)
- Most widely used in modern databases (e.g., Microsoft Access).
- Data is organized in tables (also called relations).
- Each table contains records (rows) and fields (columns).
- Tables can be linked using a common field, such as a Customer ID.
Example (from Tables 2.1 and 2.2):
- Table 2.1 contains customer information.
- Table 2.2 contains order records.
- The common field is Customer ID, showing that Bat Masamba (ID 450) made 3 orders.
4. Object-Relational Model
- Combines features of relational and object-oriented models.
- Supports storage of objects (data + behaviour).
- Useful in modern programming that uses objects (e.g., Java, Python).
- Suitable where applications need to interact closely with stored data.
5. Object-Oriented Model
- Stores data as objects, similar to those used in object-oriented programming.
- Objects contain both data and functions.
- Still not widely used in mainstream DBMS but useful in complex applications like simulations and
engineering systems.
2.5 Database Structure
- In RDBMS (Relational Database Management Systems), data is organized into a schema.
- A schema defines the structure of the database, including:
- Tables
- Fields (columns)
- Relationships between tables
Understanding Database Elements
A database is an organized collection of data. In a school system, for example, it helps manage
information like student records, teachers’ details, subjects offered, and exam results. The key
elements of a database include fields, records, tables, and the database itself.
1. Field
A field is the smallest unit of data in a database. It stores one type of information.
Example: In a student register, fields include First Name, Surname, Gender, or Admission Number.
2. Record
A record is a complete set of related fields about one item or person.
Example: A single student's full details (name, date of birth, grade) form one record in the student
table.
3. Table
A table is a group of records arranged in rows and columns. Each row is a record, and each column is a
field.
Example: A “Students” table stores all students' records in a school.
4. Database
A database is a collection of related tables. It allows for data storage, management, and easy retrieval.
Example: A school database may include tables for *Teachers*, *Students*, and *Subjects*.
Database Schema (Fig 2.3 Explanation)
A schema shows how tables are related in a database.
In the diagram:
- The Teachers table contains personal details of teachers.
- The Subjects table stores subject information.
- The TeacherSubject table links teachers to the subjects they teach.
These tables are connected using keys like `TeacherID` and `SubjectCode`.
2.6 Creating a Database
Microsoft Access is a database application in Microsoft Office used to create, manage, and manipulate
databases. Common versions include Access 2007, 2010, and 2013. In MSCE studies, we often use
Access 2013 to learn basic database design and operation.
Steps to Follow Before Creating a Database
Before creating a database, proper planning and design are important to ensure the database works
efficiently. Consider the following:
1. Estimate data volume
Determine how much data you expect to store. This affects how many tables you will need.
2. Understand user needs
Find out what inputs, outputs, and relationships are needed. This helps define tables and fields.
3. Create a prototype design
Sketch or plan tables on paper first. List fields needed in each table.
4. Normalize data
Split data into related tables to avoid repetition. This process is called normalization.
5. Identify the primary key
Choose a unique field (like Student ID) to identify each record. This is called a primary key.
6. Prioritize important fields
Arrange fields that are frequently used (e.g., names, dates) to make searching easier.
7. Design forms and reports
Plan how users will enter or view data using forms and how results will be shown in reports.
Using Microsoft Access 2013 to Create a Database
Follow these steps to create a database:
1. Open Access
Click Start > All Programs > Microsoft Office > Access 2013
2. Start a new database
On the startup window, click Blank Desktop Database (see Fig 2.4).
3. Name the database
Type a name like `School` and choose where to save it. The file will have a `.accdb` extension.
4. Click ‘Create’
Access will open with a blank table ready for data entry (see Fig 2.5 in the book).
Why This Matters in MSCE
Learning how to create a database helps students:
- Store school or business data properly
- Avoid duplication of records
- Retrieve information quickly
- Gain practical IT skills used in real life