Understanding Database Records and Fields
Understanding Database Records and Fields
Introduction
Managing data as a resource is a very important task in any organization nowadays. This is because
data forms an important part of strategic, tactical, operational management as well as decision
making in an organization. To ensure convenient (suitable) and easy storage and retrieval of data,
organizations use databases.
Definition of Database
A Database: is a collection(group) of related data items that has been organized to provide easy,
consistent and controlled access to data.
OR
Types of Databases
Manual Databases
This is a database that consists of files and folders each properly tagged and kept in an
appropriate sequence in a cabinet.
• Admission office in a school stores students files identified using unique student admission
number e.g. 1/2020, 200/2019.
Note: Manual organization of data becomes difficult and time consuming as data and information
grows(increases)
ii. Lack of flexibility: It is difficult to search for requested file or record or update records since
these tasks are done manually so more effort is needed.
iii. Lack of data integrity: Poor storage and maintenance of data may lead to unreliable and
misleading reports. i.e. some records may not be complete due to difficulty in updating (e.g.)
some elements such as Age of student may not be up-to-date or may not be available in
some students records.
1
iv. Lack of data sharing: Data or information in different manual files may not be available to
other users. E.g. one may lock the files in a filling cabinet making them unavailable to other
people.
v. Huge volumes of data requiring large storage space: Data in manual files is bulky as such it
takes more storage space (i.e. more filling cabinets needed) unlike electronic data which is
compact hence takes less storage space e.g. more data is kept only in one computer.
i. Improved data/information security: The records are on paper as such they cannot be lost
through virus attack or accidental deletion. Note: there is still danger of unauthorized access
so keep the files in locked places.
ii. It is relatively less expensive: Manual database does not require use of computers as such
no money is spent on purchase of computers and software.
iii. It does not require special technological skills : No need for one to have skills to work with
computer hardware and software since it does not require use of any of these.
Electronic/Computerized Databases
This refers to the use of electronic devices(i.e. computers) to store and organize files for easy
access. e.g. in windows, related files are collected and stored in an electronic wallet called a
folder.
Note: Electronic or computerized filling system mainly involves creating and manipulating
databases using software called Database Management Systems(DBMS)
A DBMS: is a software that provides tools for creating, storing, searching and manipulating
databases.
• Microsoft Access
• Oracle
• Fox Pro
• Lotus Approach
• Oracle MySQL
a) There is improved security and integrity: Electronic database is protected from unauthorized
access and modification of records using passwords.
b) Files/records are well organized for easy and quick access, retrieval and sharing. DBMS have
objects for searching for required records (i.e. Queries). This saves effort.
2
c) Data is compact meaning that it takes less storage space since it is stored in electronic form .ie
not need for filling cabinets or shelves.
d) Data is kept current or up-to-date. This is possible because DBMS provide tools for easy and
quick updating of records in multiple files.
e) There is easy interaction between databases and other application programs e.g. data can be
transferred between application . E.g. one can copy records from a database table and paste it in
a document.
a) Sometimes data may be accidentally deleted or may be attacked by viruses: This may lead
to data loss which may also affect work operations.
c) It needs one to have skills to work with computers and database software
Functions of DBMS
d) Ensuring security and integrity of data by safeguarding it against unauthorized access and
modification
DBMS software consists of objects or features that are used to create and manage databases. The
common objects available in DBMS such as Microsoft Access are:
1) Tables
2) Forms
3) Queries
4) Reports
1) Table
A table is a database object that is used to store or hold related records about a particular item
described in a database. E.g. A student table hold records of students.
• A table is organized into rows and columns. Each row represents a record while each column
represents a field in each record.
Note:
3
A record: is a collection of related fields that belong to (represents) a single item described in
a table.
An example of a record is a row in a student table containing Student First name, Surname,
Age, Class, Age as fields
A field: is a single characteristic(attribute) that defines a single data value of an item or entity
described in a table. E.g. A Students’ Age, First name, Surname are fields. E.g John, 15
• Each table describes a single entity(item) i.e. it contains data about a single item e.g. A
student table only contains Students ‘ records.
• Each table must have a Primary key field. This is a field that uniquely identifies each record.
This field must not contain null values and must not contain repeating values. For example,
a Student ID number is a primary key field as it uniquely identifies a particular student.
2) Forms
A form is a database object that is used for entering and updating data in database tables and
also viewing data from a table or query.
Forms usually resemble an ordinary paper form which is used to collect and enter data into
database tables.
3) Queries
A database query is an object that is used to request (ask for) required information from a
database that meets a particular criteria.
For example, you can create a query to search for records of students whose Age is 20. In most
DBMS ,queries are written in a language called Structured Query Language(SQL)
4) Reports
A report is a database object used to present or display data from a database in a more
professional and printable format or layout.
Note: when creating a database, you create these objects starting with tables.
Database Models
A Database model is a logical structure that determines how data is stored, organized and
manipulated by DBMS software.
4
Types of Database Models
There are five types of database models but the commonly used are three models:
Other older types of database models are object-oriented model and object/relational model
This is a database structure in which data is organized in related levels from top to bottom
(forming an upside down tree-like structure) with low level records(Child records) under high
level records(Parent records).
To access level 1 data, a user has to access the root(main data item) and then follow the path
to the level 2 and then a specific path leading to each item at lower levels. Hierarchical
model is no longer in use in modern database systems.
In hierarchical database model, a parent record can have many child records under it, while a
child record can only have one parent creating a one-to-many relationship between parents
and children records.
Note: There are no connections between child records.
i. It is very easy to find data( since one just has to trace through a parent record from top to
the next levels down to get to the data required).
ii. It is easy to store data since you just add the data to its parent.
i. It is easy to loose data because once you delete a parent record all its child records are lost.
(its not flexible).
ii. You cannot add a child record if it does not have a related parent record.
iii. It is difficult to relate different records as such some records must be repeated. E.g. a teacher
handling two subjects in different departments will have his or her record repeated in the
departments since no child records connections are allowed.
5
b) Network Database Model
This is a database model which allows one or more child records(member records) to be
related to one or more parent records(owners).
The network model allows each record to have multiple(many) parents and child records
forming a lattice structure that represents a many-to-many relationship.
Note: In network model, access to a record can be through multiple paths and from several
records.
ii. It is easier to retrieve data since records can be accessed through multiple(many) paths and
from several records e.g. to find John you can go through either of the departments.
iii. It is not easy to loose data as child records (members) may have many parents (owners).
Deleting one parent may not necessarily result in loss of child records if they have another
parent(owner)
Records that are not linked are difficult to retrieve. E.g. a record of student not doing any of the
subjects may be difficult to retrieve.
This a database model in which data is organized into records that are stored in related
tables (Relations).
The relational database model is the most popular and widely implemented model in most
DBMS software.
It is called relational model because two tables can be linked together such that a record in
one table references (points) to a record or records in another table. See the Parents and
Students tables on the next slide:
6
• The two tables are related to each other through a field PARENT ID and PARENT ID
NUMBER. In the example, the Student table shows that Parent2 has two students
(children) : Student1 and Student2.
Note: In relational database model there are no access pathways down to data. Instead, data in the
tables are related by a common data element in a foreign key field. A foreign key field is a field of
another table that is introduced in another table in order to relate(link) the records in the two tables.
Note: Microsoft Access uses Relational database model hence it is called a Relational Database
Management System (RDBMS)
ii. It is possible to establish more relationships between data in the tables so long as each table
has a primary key field. Note: A primary key field is a field that uniquely identifies a
particular record in a table. E.g. STUDENT ID in Student table is a primary key field as it
uniquely identifies a record of each student. Note: A primary key field must contain unique
values(i.e. no duplicates) and must not contain null values(i.e. no blanks)
iii. It is possible to automatically retrieve data from several tables and present the data as if it
were stored in one table using queries.
• Searching required data can be time consuming(i.e. may take more time) if there are many
tables linked to each other.
Relational database management system like Access organizes data into a structure called a Schema
for easy storage, retrieval and manipulation.
A Schema: is an organizational structure made up of fields at the lowest level and database at
the highest level. OR it is an outline in which data is organized.
A relational database is organized in related tables and each table consists of related records
made up of related fields.
7
A database collects different tables. Each table describes a single entity(item) e.g. student or
parent. A table collects related records and each record is unique. A record is a collection of
several fields that represent a single data item or entity.
Creating a Database
Note: This discussion will be based on Microsoft Access: an application software for creating and
manipulating databases. It comes in various versions such as 2007,2010.2013 etc.
Designing a Database
Note: Before creating a database, first design it. The design results in better storage, access and
maintenance of records in the database.
Ask yourself what entities or items are to be described (represented) in your database. This is
important because it helps you determine the number of tables to be created e.g. if the database
will store information about students and their parents then two tables will be contained.
Note: To rightly determine the data that will be stored in your database, you must first establish the
purpose of the database e.g. fees tracking database, hospital management database etc
Find out from the users about what and how the input and output should be and what are the
required relationships between data.
Design a sample database on paper to determine fields and tables required to implement the
database. E.g. Student first name, Student surname, Age, Parent name, Parent Surname , Student Id
number,Parent Id number etc.
d) Normalize the fields into separate tables to allow flexibility in database manipulation
e) Normalization: is the process of decomposing fields into separate but related tables.
This is the stage where you create the tables manually allocating each field to its rightful table .
8
A primary key field is a field that is used to uniquely identify a record. Identify a field that will be a
primary key in the tables to be contained in your database. E.g. Student Id Number will be a primary
key in Student table.
f) Give the most important fields first priority when designing a table structure.
Fields that will be used to sort and search for records in a database ( e.g. primary key field) must be
put first in the table.
g) Design sample data forms and reports needed for interaction between the users and the
database system.
• The forms should indicate fields that will be used for entering new records in the tables(input) .
• The Reports indicate how data will be presented from the database(output)
v. Type the name of your database e.g. Clinic management and also specify the location you
want to save the database file.
vi. Click Create button. A blank database with a default Table 1 will be created.
vii. To create a new database from Template, choose from the templates e.g. Contacts
viii. Click on the open icon to specify the location you want to save the database file.
Note: Database files are saved at the beginning of your project. After creating the file, you can start
creating objects such as tables, forms, queries and reports and you save the objects as you create
them or as you edit them.
Note: When you first launch Microsoft Access, it creates a default(automatic) table: Table 1. You can
customize this table to suit what you want. To do this:
1. Click the icon for the table in the Objects(left) task pane
OR
• Right-click the table icon and choose Design View from the shortcut menu
9
4. The Save As dialogue box opens prompting you to save your table with a name. Type the
name for the table e.g. Student
5. Click OK. The table will be renamed and the Table design view will open the table design
grid.
Note: Table design view: is a view of a table that shows the design structure of the table. It does not
show records in the table but field names and their data types.
• After adding fields, setting primary key, data types etc remember to save the table and the
changes made to its structure. To do this click save icon OR press Ctrl + S.
• Choose Close.
Double click your table name to open your table in Datasheet View to start entering your data in the
fields.
Note: Datasheet View: is an object view(table view) that displays rows and columns where you can
type data (or shows records or data contained in the object or table
A primary key field is a field that uniquely (specifically) identifies each record stored in a
table.
Note: A primary key prevents the user from making duplicate entries in a table meaning that a
primary key field must not contain duplicates. It must also not be blank. When you set a field as
primary key, Access uses it to order(sort) records and also control redundancy (duplication of
records)
10
To set a primary key field:
ii. Select the field you wish to set as primary key by clicking in the row header on the left of the
Field name. e.g. Student Id number
Note: A primary key field is automatically indexed meaning that it can be used for searching or
sorting records. It is a primary index. This is a primary key field which has also been set as an index.
Note: A secondary index: is any other field(which is not a primary key field) which has been set as
an index.(i.e. a tool for searching and sorting records in a table).
ii. Click Design tab and click Indexes button in the Show/Hide command group. The index
dialogue box opens.
iii. In the Field Name column, select the field you wish to set as Secondary index other than the
primary key field e.g. Student First Name, Phone Number etc
iv. In the Index name column, type the name of the Index e.g. Name Index, Phoneindex etc
v. Choose the sorting order e.g. ascending or descending order. This defines the order in which
searched records will be arranged after being retrieved by the index.
vi. Click Save icon then close the Indexes dialogue box.
A field data type: is a specific type of data that will be stored or held in a particular field in your
tables.
It is a characteristic of a field that determines the type of data to be stored in the field.
• It ensures that only data that meets the set data type is entered or allowed in the field otherwise
it refuses the entry. This helps to normalize data in the field.e.g. an entry John will not be
allowed in field set with a data type Number since John is text characters not a number.
• It determines the purpose for which data will be manipulated e.g. data type Number means that
the numbers entered in that field can be used in a calculation.
Below are data types that you can apply to the fields
11
FIELD DATA TYPE DESCRIPTION
Text (or Short Text) This data type includes alphabetic letters, numbers, spaces and punctuations or
combinations of these, that do not need to be used in calculations e.g. Names,
Phone numbers. This field accommodates a maximum of 255 characters.
Memo(or Long Text) This field data type stores long text up to a maximum of 65,535 characters. E.g. a
memo letter. Any textual entry of more than 255 characters should be entered in a
field with memo data type.
Number This field data type holds numeric values 0 to 9 that are used in mathematical
calculation. The size of this field is 1,2,4,8 bytes.
AutoNumber This field data type stores(holds) unique sequential numbers automatically
increased(incremented) by 1 .e.g. 1,2,3,4,5 or 001,002,003,004 etc.. The numbers
are increased by 1 each time you enter a new record in your table.
Date/Time This field data type is set to fields that store date and time. This is so because dates
and times can also be calculated. E.g. you can calculate age of a person from 1974 to
2021. The field size for this data type is 8 bytes.
Currency This data type is set to fields that store numeric values that have monetary values
or decimals e.g. Salary. The field size is 8 bytes and more.
Yes/No This is a logical data type for an entry that has either Yes or No or True or False. E.g.
a field that requires one to answer to HIV positive status. The field size is 1 bit. Here
one clicks in the check box for Yes and leaves the box unchecked for No.
Lookup Wizard This field data type creates a field that allows you to choose items from a list of
items using a list box, instead of typing the entries. E.g. Male, Female. The field size
is 4 bytes.
Hyperlink This field data type is for storing text and numbers used as links to other files or web
pages. E.g. e-mail addresses such as peter@[Link]
OLE(Object Linked or The term OLE is an acronym for Object Linked and Embedded. This field data type is
Embedded Object) for storing graphical objects such as pictures, drawings and charts.
Attachment(available in This is a field data type that stores one or more files containing pictures, sound,
Microsoft office Access 2010 video or word document.
onwards)
Calculated(available in This is a newer field data type in Access that is used to store data created from a
Microsoft office Access 2010 formula especially if the value will be used in queries, forms and repots.
onwards)
12
Field Properties
When creating more complex tables, you need to use field properties to specify details related to
each field in the table. The properties depend on the field data type you applied. Below are the field
properties:
Field size This property allows you to set number of characters to be accommodated in the field
instead of the default. E.g. the size 255 only accepts 0 to 255 characters.
Format This determines how information appears on the screen or when printed e.g. you can
format a number as currency, percentage or general.
Decimal places This property applies to numbers and currency data types. It specifies the number of
decimal places
Input mask This is used to format a field entry into a specified format. This is mostly used to format
phone numbers and address entries e.g. the input mask 000-(0000)-000 will display
phone numbers with a format 099-(9987)-444
Caption This is a more descriptive name for a afield that is used in forms or a table. E.g. a
caption for STUID could be Student ID Number.
Default value This is a value that will automatically appear in the datasheet if nothing typed in the
field cell by a user e.g. =DATE() will automatically display current date.
Validation rule This is an expression that limits values to be entered in a field.e.g. when you type the
expression Between>=10 And <=50, the field will only allow entry of numbers between
10 and 50 in the Age field. When a user enters a value that violets the set rule Access
displays a custom message called a validation text.
Note: After specifying field data types and properties, save your table and close the design view.
Open the table in data sheet view and enter some records.
Note: Datasheet view is a table view that shows fields and records. It is the view in which data entry
can be done. To create a table in datasheet view:
13
iii. A new table is added with ID field(Primary key field) which you can edit by double-clicking
and “Add New Field” as a next column. Yuu can double-click the ID field and type a field
name for the primary key [Link]
iv. You can resize the column by pointing the border line and then click and drag the border
when the resize handle appears.
v. Click Save icon to save your table. You can open your table in Design View to add data types,
field properties and also change primary key field. Save the changes made then close design
view and open the table in datasheet view to enter data
Manipulating Records
There are many ways of entering new records in a database table. Below are some notable ways:
• Pencil: This means that the current record is not yet saved. Note: in Access 2007, a record is
automatically saved in a table after it has been typed.
• Asterisk (*): This marks a blank record below the current entry.
• Arrowhead: This indicates that there is no new data entry or no edit is pending..
Record locked: This indicates that the current record is being edited by another user in a multiuser or
networked environment
14
Deleting Records
b. Click the row header of the record(s) you want to delete in order to select the records.
c. Click Home tab and then choose Delete in the Records command group. Access will prompt
you that you are about to delete 1 or 2 records if you selected 2 records
OR
OR
a. Click on the left border of the cell when the cell indicator appears to select the cell
iv. Type the word in the Find what box you want to search for and word you want to replace
with in the Replace with box. You can also use Wildcards such as asterisk(*) or question
mark(?) e.g. type J* in first name or type the name
Use the Copy command to create a duplicate copy of records in another table and Cut command to
move a record to another table. To Copy or move a record:
iii. Open the other table(i.e. destination/ target) table in datasheet view
15
Sorting and Filtering Records:
Filtering: refers to extracting a subset of records from a table that meets a given criteria.
iii. In the sort and filter group click Sort icon for Ascending or Descending order
Important note: Numbers stored in text field data type are sorted as text so they must be given same
length(i.e. they must be padded) for example 1,11,2,22 must be 01,11,02,22 then sort them.
Filtering records
a) Filter by common filters where you filter by using a particular value which is checked
b) Filter by selection where you filter for records that contain the selected value e.g. age 17
c) Filter by form which involves filtering records using more than one field e.g. First name and
Surname
d) Advanced filter in which you filter records that meet a particular criteria(condition) e.g.
Surname “Banda” Or “Tembo”
i. Open the table in datasheet view and click a field you want to filter by
ii. Click Home tab. In the Sort and Filter command group , Click Filter icon that looks like a
funnel
iii. To filter for a specific value, use the check box. Only the records with the checked field
will be displayed after clicking OK.
• Click “Toggle Filter” in the Sort & Filter group OR choose Clear All Filters on Advanced
c) Filtering by Form
This technique involves filtering records by using more than one field. E.g. Filtering for
records of students whose first name is Andrew and Surname is Banda, Age is 20 and is a
Vegetarian. Note: filtering records using more than one field helps to narrow down the
search. To filter using more than one field:
16
i. Open the table in datasheet view and Click Home tab
ii. Click on the arrow on Advanced in the Sort & filter command group and choose “Filter by
Form.” A blank form with fields in the table will appear.
iii. Click each field, an arrow will appear to the right of each clicked field. Click the arrow and
choose an entry for each field you want to include in the filter. For Yes/No fields click the
checkbox for Yes and uncheck the box for No
iv. Right-click the form filter and click Save or Click save icon to save the form fields as a Query
with a name e.g. Student20
v. Double-click the name of the Query to view the results of the filter. To get back to all
records, just close the query and get back to the table.
d) Advanced filter
This involves filtering records using particular logical complex criteria. E.g. Filter for students
whose Surname is “Banda” Or “Phiri” another example could be filtering for Students
records whose First Name starts with A which will be “A*”
To do this:
ii. Click on the arrow on Advanced in the Sort & filter command group and choose “Advanced
Filter/Sort” a query design window opens showing the Table fields you can base your
filtering criteria on or you can add more fields.
iii. Click any field in the Sort row to specify the sorting order for the filtered records e.g.
Ascending .
iv. Click in the Criteria row and specify your filtering criteria against each field. E.g. click
Surname field in the criteria row and type Banda Or Tembo
v. Click Save icon to save the filter query with a name. To view the results of the filter , run the
query by clicking Run icon
a. Like “Banda” this will display records of students with surname Banda.
b. Not “Banda” this will exclude students’ records with surname Banda.
c. Like “P*” will display records of students whose surname start with letter P.
d. Not “P*” this will display records of students whose surname does not start with letter P.
e. Between 16 And 50 if typed in age field in criteria row will display records of students whose
age is between 16 and 50.
f. Like “*A” will display records of students with surname ending with letter A.
17
i. Click Microsoft office button or click File menu while the records are displayed in datasheet
view.
iii. Choose the page orientation you want in the page layout group e.g. landscape and choose
the paper size you want e.g. A4
iv. Click Print. Specify the number of copies you want and print range e.g. All
Note: If you want to print only a selected record in a table, first select the records and proceed with
the printing steps and choose Selected Records under print range.
Modifying a Database
After creating your database, one can modify the tables’ datasheet or structure, export tables to
another database or even import tables from another database. The following are tasks involved in
modification of database:
ii. Point to the column border between the column headers then click and drag to the required
size.
i. Point to the border between the row headers then click and drag to the required height.
iv. Click Ok
18
To add a column(field):
i. Right-click on the header of the column to which you want to add a column to its right.
iii. Double-click the automatic field name and type a name you want
To add a row(record):
i. Right-click a row
To delete a column(field):
ii. Right-click in the column and choose Delete column from the shortcut menu.
To delete a row(record):
i. Right-click a row
This involves switching positions of fields in a table. E.g. you can move First name field before
Surname field. To reorder fields to the following:
ii. Click and drag it to the right or left to the position you want it to appear.
Note: When you want to make some changes to your database tables, it is advisable to save a copy
of the table to avoid losing anything in case you make a mistake. Remember: Changes made to the
database tables (e.g. deleting records) cannot be undone.
To export a table:
ii. Choose Export from the shortcut menu and choose the destination e.g. to Access database
OR
ii. Click Microsoft office button or File menu and choose Save As or Save object As
You can relate tables in your database. Relationships between tables enable Microsoft Access
bring data or records from various tables back together as if they were saved or held in one
table.
19
One of the technical part in design of relational database is to link tables using a foreign key
that references a primary key of another table. A foreign key is a field in a database table
that matches primary column(primary field) of another table. It is basically a primary key of
one table introduced in another table to relate records in the two tables.
For example, to keep track of a parent for each student, introduce Parent ID field (a primary
key in Parent table) in the Student table (as foreign key) to indicate a parent for each student.
The Parent ID will be a foreign key field in the Student table since it is not originally supposed to be in
that table. It has just been introduced to relate records in the two tables.
Types of Relationships
There are three types of relationships that can exist between records in tables. The relationships are
named according to the number of records that are involved in the relationship. The types are:
a) One-to-one relationship
b) One-to-many relationship
c) Many-to-many relationship
a) One-to-one relationship
This is a type of relationship in which the primary table(reference table) has only one related
record in the related(child) table and vice versa. This means that a record in the
primary(reference) table will only be related to one record in the related(child) table.
For example: In a marriage database with two Husband and Wife tables, assuming that these
are Christian marriages, then one husband record will be related to one wife record only.
Note: Relationships between records in tables are represented using a diagram known as Entity
Relationship Diagram(ERD)
20
Note: Most one-to-one relationships are forced by rules that do not follow naturally from data(i.e.
rules from an institution). In the absence of such rules, you can just combine both tables(i.e. put the
records in one table)
b) One-to-many relationship
This is a relationship in which a single record in the primary table corresponds to(relates to)
more than one record in the child or related table, but each record in the child table is
related to only one record in the primary table. For example, one parent can have many
children, while each child has one parent. Below is an Entity relationship diagram
representing one-to-many relationship
Note: Relational databases do not directly handle many-to-many relationships. To represent this type
of relationship, there is need to create a third table known as an associated table that converts the
relationship to two one-to-many relationships.
E.g. Create a one-to-many relationship between Parent and student Tables. To do this follow the
steps below:
1. Introduce(include/type) Parent ID field (from primary table i.e. Parent table) as a foreign key
field in student table(related/child) table. To do this open the Student table in design view.
Type the Parent ID field in it. NOTE: Make sure that the primary key and its corresponding
foreign key have the same data type. E.g. Primary key Parent ID has Text as data type and its
foreign key field Parent ID in student table has Text as well as its data type.
2. Save the content you have added to the table design view and exit the design view.
21
3. Click Database Tools tab, then click Relationships button. This opens the
relationship window.
5. Click Tables tab, the table names will be displayed. Select the tables you want to relate ie.
Parent table and student table, then Click Add button.
Note: the tables will be added and displayed in the relationship window. You can point on the edges
of the tables and resize the tables by clicking and dragging to see all field names
7. Drag Parent ID(primary key) from primary table Parent Table and drop it onto the Primary
ID number(foreign key) in the Student table(related table).The Edit relationship dialog box
appears. If needed, you can enforce referential integrity(i.e. each record must be related to
another).
8. Click Create button to establish the relationship. The relationship is indicated by a joint line
between the primary key and its corresponding foreign key.
Note: You can edit or delete the relationship by right-clicking the joint line.
9. Click on Save icon to save the relationship you have created before closing the relationship
window.
10. Open the child(related table) i.e. Student table in datasheet view and type Parent ID
assigning a parent to each student record.
Note: Creating one-to-one relationship involves the same process only that when you will be typing
data in the foreign key field there will not be any repetitions since one parent will only relate to one
child record.
Referential integrity is a relational database integrity rule that ensures that every record entered
in the child table(related table) has a related record in the primary table. E.g. There must be no
student record without a parent. When you enforce this Access will not allow you to enter child
records with blank Parent ID number(foreign key) field. To enforce referential integrity:
22
i. Click Database Tools tab, then click Relationships to display the relationship window.
ii. Right-click the joint link between the two tables and then click “ Edit Relationship” to open
the dialog box
iii. Select “ Enforce Referential Integrity” check box to enforce referential integrity
• Introduce the field Teacher_IDD in Subject table as foreign key field to link the tables
Teacher and Subject.
• To create many-to-Many relationship between Teachers and Subjects introduce a third table
TeacherSubject with the fields: (Teacher_ID, SubjectCode, Term, Academic Year)
Note: The primary key of TeacherSubject table is a composite primary key(i.e. Two-in-one primary
key) borrowed from the two related tables. The fields Term and Academic Year in the TeacherSubject
table depend on the composite primary key Teacher_ID ,SubjectCode.
ii. Press and hold down the Shift key as you click the fields to make the composite primary key
i.e. Teacher_ID and SubjectCode
v. Click Show Table to display the show table dialog box. Click each table and use the Add
button to add the Teacher table , TeacherSubject table and the Subject table to the
Relationships window.
Click and drag the Teacher_ID primary key from the Teacher table and drop it onto the Teacher_ID in
the TeacherSubject table. Next drag SubjectCode primary key from Subject table and drop it onto
SubjectCode in TeacherSubject table
In the Edit relationship box click Create button to establish two one-to-many relationships
forming many-to-many relationships. Click Save icon and close the relationship window
23
Enter data in fields to indicate the relationships between records in the tables.
See the records in the third table(TeacherSubject table) one teacher (i.e. Teacher1) is teaching
more than one subject( Subj21 and Subj02) creating one –to- many relationship at the same
time, one subject(i.e. Subj44) is being taught by many teachers(i.e. Teacher 2 and Teacher 3)
creating another one-to-many relationship. There are two one-to-many relationships in the table
Below are buttons that help you navigate between records in your table when you open it in
datasheet view. Note: The buttons are located in the Record bar which appears at the far
bottom of your table datasheet view window.
A form is a database object that enables the user enter data into and also view data from
tables or queries.
• A form is basically a graphical interface that a user uses to enter records or view records from
tables or queries in your database. For example: you can create a form with students fields to
enable you enter new data or records in the students table without typing the data directly
in the table. Note: You can design and create a form in two ways :
24
i. In Design view
In Microsoft Access, a form is designed using a form object and field controls.
A control is an object (e.g. a textbox,checkbox,button, label) that you can place on a form design to
display data or perform an action. To display controls:
ii. Click “Form Design” the controls are displayed. You can click and draw each one of them
onto the form design.
Types of Controls
a) Bound Controls:
These are controls whose source data is a field in a table or query e.g. Student ID label on a
form design will identify entries in Student ID field
a) Unbound Control:
This is a control that is not related to any data source(i.e. not related to any field in any table)
in your database. E.g.. Textbox where you can type your own text like your name on the form
Note: When designing your form you place the controls in their required position be it in Header
section, Detail section or form footer. You can also resize these sections of a form by clicking and
dragging the borders.
A form can be designed using a form wizard. A form wizard is a feature that takes you through
series of steps to select fields, layout of data and background style for your form. To create a
form using a form wizard:
a. Click Create tab in the forms command group. Click More Forms then choose Form Wizard.
b. In the Form wizard dialog box, select the table or query you want to create a form for (e.g.
Parent table) and select the fields you want to appear on the form. Use the single arrow to
move each field from the source fields to the selected section. Use the double arrow to
move all available fields from the source table or query to the selected fields section to be in
your form.
25
c. Click Next button and specify the form layout. Layout refers to how data will be displayed on the
form.
Columnar form: This layout displays fields for each records down a column. Each value is
displayed on a separate line with field labels to the left.
Tabular form: This layout displays records from left to right across the page. The labels
appear at the top of each column and each row represents a new record.
Justified form: This is a form layout in which one record occupies the whole from.
d. Click Next button and specify the style for your form. A form Style is basically a background
of your form. E.g. Apex, Aspect, Median and others listed styles.
e. Click Next button and save your form with a name e.g. ParentForm . Click Finish button to
open and view the form and enter new records using the form. You can also modify your
form in form design view.
To add a new record to the table, click the new record navigation button to get to a blank
record and type the new record then click Save icon to save the data you have just entered
using the form.
1. Click Microsoft office button while the form is open or click File menu
2. Click Print.
This involves designing a form from scratch using the design grid.
26
2) On the right of design grid is a Field List pane. Expand the list for each table by clicking the
plus sign at the beginning of the table you want to get fields from to be in your new form.
3) Drag and drop the fields from the fields list on the design grid.
4) Add other controls on the form such as Buttons,, Text boxes etc.
• You can also resize field names and their labels boxes to a size they will be able to display all
content(i.e. not cut content)
• You can also move the fields using the move handles that appear at the top left corner of
each control by dragging.
5) Save your form by clicking Save icon and type a name for the form e.g. ParentForm and Click
Ok. You can then open your form in Form View to enter new records or view existing records
in the tables.
Creating Queries
A query (in database context) refers to a question that is used to instruct a database to retrieve(get)
particular data or perform a particular operation e.g. delete or update data.
• The language used to query a database on behalf of the user is called Structured Query
Language (SQL)
A. Select query
B. Action queries
A. Select query
This is a type of used for searching and retrieving required data from one or more tables in
the database.
Note: Select query enable users to search for data from the database using specified criteria and
displays the records that meet the specified criteria in a query datasheet called a dynaset.
B. Action queries
27
These are queries that are used to perform actions that make changes to records in tables in
the database. Action queries are used to delete, update, add a group of records from
another table or creating a table from another table. Below are types of action queries:
i. Update query
Update query This is an action query that updates data in a table. E.g. you can
update ones age.
Append query This is an action query that adds data (records) in a table from
another table
Delete query This is an action query that deletes specified records from one or
more tables.
Make Table query This is an action query that creates a new table from a dynaset(i.e.
records obtained after a search)
Note: Queries can be created in two ways :using query wizard and in Design view tool.
i. Click Create tab and click Query wizard command. This opens the New query dialog box.
ii. Choose Simple Query wizard in the dialog box and click Ok.
iii. Under Tables/Queries click the table or query that has fields you want to include in your
query e.g. Parent table and pick the fields you want to be included using the arrow buttons
and click Next button
iv. Type the Title or name for your query to save the query and click Finish button to finish the
wizard and view the results of the query.
• Open the query you have created in Design View and type the criteria(condition) under the
field you want to search for the data you want in criteria row.
28
• Remember to click on Show check boxes under the fields you want to be shown in your
query.
Note: Since a query is a question, it will get different results each time you change the criteria in each
search. When you type a search criteria, run the query by clicking the Run icon on design tab to get
the results that match the search criteria.
i. Click Create tab and choose Query Design. The show table box opens displaying names of
tables in your database and also previously created queries.
ii. Click the tables or queries with the fields you want to include in your query and Add then in
query design window. E.g. Parent or Student or both tables. Click Close to close the window.
iii. Click and drag each field you want to be in the new query and drop it in a particular column
in the Field row in the query design grid until all the fields you want are included.
Field row This show or displays fields from tables to be used in the new query. Each field
occupies its own column.
Table row This shows name(s) of tables or queries from which a field was obtained
Sort row This allows you to specify the sort order i.e. ascending or descending by clicking in
it under a particular field.
Show row This allows you to specify whether to display a field in the query results or not. If
the box is checked , it means the field will be displayed in results.
Criteria row This is where you enter a condition or expression that will be used by the query to
display specific records.
Or row This is used to specify an alternative condition for searching( e.g. Type Banda in
criteria row and Phiri in the Or row to get students’ records with surname Banda
or Phiri.
iv. Specify query criteria(i.e. search criteria or conditions) in each field you want to use for
searching records.
To search for a particular set of records, you have to enter a conditional statement in the criteria row.
E.g. type >20,000 in the fees field to get records of students whose fees is greater than 20,000.
Note: When defining query criteria use either relational or logical operators.
29
Relational operators include:
• Equal to =
• AND e.g. >40000 AND <50000 will display records with fees greater than 40000 but less than
50000
• Not e.g. Not 20000 will exclude records with fees 20000
• LIKE e.g LKE “ Banda” will get records with surname Banda.
Note: You can also use wildcard characters to search for records you only remember part of
characters in them e.g. LIKE “B*” will get records of students with a surname that start with B and
continues with any characters . Or use LIKE “B????”
Note: When searching fields with Yes/No data type, Type Yes or No in the search criteria .
v. Save and run your query: Click the Save icon ands type a name for your query. Click Run icon
on the Design tab to search records and display the results
a. Open the query in Design view i.e. Right-click the query name and choose Design view.
b. In the Sort row specify the sort order on the desired field e.g. Ascending order by Surname
Modifying Queries
This involves removing some fields, resizing columns, changing the search criteria and
changing fields to be displayed.
2. Select the column containing the field you want to delete by clicking its header
30
1. Open the query in Design view
2. Position mouse pointer on the border that separates column headers then click and drag to
the column width you want.
OR
3. Click Save button to save the new criteria and run the query to display new results
A Report is a database object that is used to summarize and present information from a
database in a more professional and printable layout. A report can be designed in two ways:
In Design view
A report wizard takes the user through a number of steps by answering a few questions and then
automatically creates the report. To generate a report, proceed as follows:
2) Click the Create tab and then click Report Wizard button in the Reports group
3) On the New report dialog box, select the Table/Query and the fields to be added to the
report using the arrows and then click Next
4) The wizards prompts you whether you wish to add grouping .Grouping is used to classify
records using a particular field e.g. you can categorize students by using class like form 1,
form 2 etc. It keeps records together based on one or more fields. Click Next.
5) In the screen that appears, select the Sort option if you want to sort the records. You can
also click the Summary options button if you want Microsoft Access to perform calculations
on some fields. Use the summary options screen box to select the summary options you
want Access to perform suck as Sum, Average, Minimum, and Maximum. Click Next
6) Select the type of layout for your report in the Layout screen e.g. Stepped, Justified. Specify
the page orientation e.g. Landscape then click Next
7) In the style screen box, Specify the report style e.g. Bold, Casual or any other. Click Next
8) Enter the name of your report then click Finish. The report will be displayed on the screen in
print preview mode.
31
This involves placing controls on the report design grid to come up with the report design you want.
To create a report in design view, follow the procedure below:
9) Click the Create tab, then select Report Design in the Reports group. A blank report design
grid is displayed.
Report Header This section contains unbound controls that display the title of
report
Page Header This contains headings or labels for the data items to be displayed
in every column
Detail section This hold bound controls that display data items for the table or
query it was created from.
Page footer This holds a control(a footer0 that is to be displayed on every page
such as the page number and date e.g. =Now() displays the current
data and time in all pages as set in the system clock
Report footer This is used to display summary information from a report such as
grand totals.
ii. To select the table or query for which the report is to be created click Property sheet in Tools
group of Design ribbon.
iii. On the displayed property sheet, click the Data tab and then specify the table/query name
in the Record Source.
iv. Click the Field list button( Add Existing Fields) in the Tools group to display fields associated
with selected table.
v. To design the layout, drag each field from the field list onto the layout grid and drop it where
you want it to appear.
vi. When you finish placing the controls, click the Save icon on the Quick Access Toolbar. Type a
name for the report and click Ok.
Creating/Generating Labels
A label is a tag placed on an item for ease of identification. Examples of tags include name
tags, mailing labels, bottle stickers etc. To generate labels using report wizard, do the
following:
32
2. Click the Create tab then click Labels button in the reports group. Labels wizard starts
running.
3. Specify the label size, font, fields to be included in the label and also name of the label. Click
Finish.
1. Select a table, query, form or report by clicking it OR open the object in Datasheet view.
2. Click Microsoft office button or File Menu and choose Print. You can also preview the object
you want to print to set page orientation, paper size e.g. landscape, A4 size .
Database Security
Data in the database must be secured. Microsoft Access provides users with a number of data
security features to secure data in the database. These features include: encryption(i.e. converting
data into a code/ symbols), password protection, hiding database objects (e.g. hiding table) and
user-level security.
Note: A password protection is one of the mostly used ways of protecting data in your database. To
protect a database using password, do the following:
1) Open the database in exclusive mode(i.e. open Access, then click File menu then click Open.
Point Open button Arrow and choose Exclusive)
2) Click File menu or Database Tools Tab, point Encrypt with password.
3) The Set Database Password dialog box appears. Type your password in the Password textbox
4) Re-enter the password in the verify text box then click Ok.
Self-Test Questions
• Database
• Database schema
• Database model
• Record
• Field
• Encryption
• Validation rule
• Validation text
33
2. Explain three ways you can use to protect your database from unauthorized access.
4. State any four advantages of electronic databases over manual filling methods.
One-to-many
Many-to-many
6. State any four database objects and give the function of each object.
Definition of terms
34
Note: the definition above is broad and covers both computer networks and other non-computer
networks like telephone networks, road networks etc.
Note: Computer networks can be classified using several aspects such as topology (i.e. star, mesh,
ring, bus), design/architecture (i.e. client-server and peer-to-peer) and size. Classes of computer
networks according to topology and design were already discussed in form 3. Below are 5 types of
computer networks according to size:
1. Personal Area Network (PAN) [also called Home Area Network (HAN)]
For example:
This is a computer network that covers(spans) a relatively small geographical area such as a
building or a school block.
Note:
• A LAN is usually owned by one organization but it can sometimes be connected to other
LANs over a distance via data transmission lines or electromagnetic waves.
• Most LANs connect personal computers and server computers on a small network. A server
computer: is a computer that is dedicated to servicing requests for resources from
workstations or clients on a network. LANS enable users share expensive devices such as
laser printers and data.
This is a computer network that covers a metropolitan area like a town or city.
A MAN is made up of many local area networks in a town or a city. It size covers a radius of
between 5 to 50km.
A MAN can be owned by a company that has offices across the city e.g. National Bank has
many branches within Blantyre city. They have interconnected local area networks in their
Blantyre branches to create a MAN.
35
This is a computer network (larger than MAN) that covers a larger geographical area. E.g. a
network that covers a country, continent or the whole world. Such as the internet.
A WAN is basically made of local area networks and metropolitan area networks connected
together to form one large network.
When a WAN covers the whole world(e.g. the internet) it is called a Global Area
Network(GAN)
This is a network of powerful computers that have powerful processors, huge memory and
data storage capabilities that can be accessed from anywhere in the world using personal
computers, Smartphone, tablets etc.
An example: Cloud computing networks where you can save your data in an online
secondary storage computer and access your file as if it were located on your local computer.
Network Topologies
Network topology refers to logical and physical arrangement of computers and other devices on a
network.
1. Star Topology
In a star network topology all nodes are directly connected to a common central computer
that is often referred to as a hub.
When the hub receives data from a trasmiting computer, it broadcasts the message to all the
other nodes on a network.
36
It allows centralization of key networking resources like concentrators and serves.
It gives the network administrator a focal point for network management. The
administrator can troubleshoot from one place.
They are easy to configure.
Network Software
B. Network protocols
These are operating systems designed to support a network by improving the ability of
networked computers to respond to service requests.
Servers run on network operating systems(NOS). Examples of network/server operating
systems are:
o Solaris
o Netware
Apart from the functions of normal O.S., NOS perform the following network related functions:
i. Providing and controlling access to network resources. e.g. shared printers, folders etc.
ii. Enabling nodes on the network to communicate with each other efficiently.
v. Supporting network services such as network interface card drivers and network protocols
(i.e. translating protocols)
vi. Implementing network security features to ensure that there is no unauthorized access to
network resources. E.g. blocking requests from unauthorized users.
Note: Internetworking devices such as routers also have operating systems of their own that
can be managed and configured to improve performance of the network. Note: Routers are
special purpose computers.
B. Network Protocols
Protocols are a set of rules and procedures that govern communication between two
different devices or people. In computer networking, Protocols are rules and technical
procedures that govern communication between different computers. They usually
determine the format of data and transmission procedure to be followed.
37
NOTE: The data transmission process over the network has to be broken down into separate
systematic(orderly) steps. At each step, a certain action takes place. Each step has its own
rules and procedures to be followed as defined by network protocols.
The work of network protocols must be coordinated to ensure that there are no conflicts or
incomplete operations between communicating devices. To achieve coordination of the work
of network protocols, protocol layering was introduced.
In a world full of innovations from different people, it is difficult to dictate uniformity on how
protocols are developed and how communication between devices on network should
happen.
To avoid network protocols that conflict, International Standards Organization (ISO) developed a
communication standard reference model for all developers of protocols world wide called the Open
System Interconnection (OSI)reference model.
Note: The Open System Interconnection (OSI) is not a protocol but a blue-print or a reference point
or a standard guideline for developing high quality protocols.
Network protocols are designed after (based on) the OSI reference model. The OSI model has
seven layers. The OSI reference model describes the flow of data in a network through seven
layers, from the user’s application to the physical transmission media. Each layer performs a
different function. (Note: On the sending side the order is from layer 7 to layer 1 while on
the receiver’s side the order is from layer 1 to layer 7)
On the sending point, data enters at the top floor (the application layer) and travels to the
bottom floor (the physical layer). Each layer communicates with the layers immediately
above and below it. When a layer receives data, it performs specific functions, adds control
information to the data, and passes it to the next layer. The control information contains
error-checking, routing, and other information needed to ensure proper transmission along
the network.
38
OSI Model Layer Function
7. Application layer This layer serves as the interface between the user and the network. Using
application software, such as an e-mail program, a user can type a message and
specify a recipient. The application then prepares the message for delivery by
converting the message data into bits and attaching a header identifying the
sending and receiving computers.
6. Presentation layer The presentation layer translates the converted message data into a language the
receiving computer can process (e.g. from ASCII to EBCDIC) and also may
compress or encrypt the data. Finally, the layer attaches another header
specifying the language, compression, and encryption schemes.
In simple terms, It is a layer where data is formatted for transmission (at sending
point) or formatted for use by an application (at the receiving end) e.g. ASCII,
JPEG (Joint Photographic Expert Group) for compressing color images)/ GIF,
encrypts or decrypts data.
39
5. Session layer The session layer establishes and maintains communications sessions. A session is
the period between establishment of a connection, transmission of the data, and
termination of the connection. The session layer adds protocols that sets up a
communication session between the communicating devices , maintain the
connection for data exchange and terminate the session after communication.
4. Transport layer The transport layer, also called the end-to-end layer, ensures that data arrives
correctly and in proper sequence. The transport layer divides the data into
segments and create a checksum (i.e. A digit representing the sum of the digits in
an instance of digital data; used to check whether errors have occurred in
transmission or storage). The information is later used to determine if the data
was scrambled during transmission.
3. Network layer The network layer routes the message from sender to receiver. This layer splits the
data segments from the transport layer into smaller groups of bits called packets.
It then adds a header containing the packet sequence, the receiving computer
address, and routing information (i.e. sending device’s network address and
receiving device’s network address e.g. IP address). The network layer also
manages network problems by rerouting packets to avoid network congestion.
2. Data Link layer The data link layer supervises the transmission of the message to the next
network node by specifying the network technology (such as Ethernet or token
ring) and grouping data accordingly. The data link layer also calculates the
checksum (A digit representing the sum of the digits in an instance of digital data;
used to check whether errors have occurred in transmission or storage) and keeps
a copy of each packet until it receives confirmation that the packet arrived
undamaged at the next node.
1. Physical layer The physical layer encodes the packets into a signal recognized by the medium (at
the sending point) that will carry them (such as an analog signal to be sent over a
telephone line) and sends the packets along that medium to the receiving
computer.
In simple terms: the physical layer encodes data (to suit the channel e.g. from
parallel to serial form),adds error checking information and transmits data bits to
a transmission medium to the receiving computer.
NOTE: At the receiving computer, the process is reversed and the data moves back through the seven
layers from the physical layer to the application layer, which identifies the recipient, converts the
bits into readable data, removes some of the error-checking and control information from the data,
and directs it to the appropriate application(i.e. application program to open and display the
message to the user)
i. The user creates a message to be sent over the network using an application program
running at layer 7 (application layer) of OSI model(e.g. an e-mail application). The user then
40
presses Send button, the message is passed to the application layer whose protocols add an
Application Header(AH) to the message.
ii. The message is passed down the layers all the way to the physical layer(at the sending point).
Each layer adds its header to the message (e.g. presentation header (PH),session header (SH)
etc. until it is sent to the network channel at the physical layer.
iii. At the receiving end, the message undergoes a reverse process(i.e. each layer rips off its
header e.g. if the message was encrypted at the presentation layer, it is decrypted at the
same layer). All headers are removed as the message goes up the layers(from layer 7 to layer
1) until the original message is presented to the receiving user application that displays it to
the receiver.
7. Application layer Simple Mail Transfer Protocol(SMTP), File Transfer Protocol(FTP)/ Telnet(for
remote login)
6. Presentation layer ASCII, JPEG, GIF etc. These protocols format the data ready for
transmission.
[Link] layer Remote Procedure Call( RPC), Point-to-Point Tunneling Protocols(PPTP), OSI
Session layer Protocol (OSI-SP)
2. Data link Ethernet, Token ring, Point-to Point Protocol (PPP), Wireless Access
Protocol(WAP)
1. Physical layer There are no protocols. It only has encoding techniques, bit streaming and
transmission techniques e.g. baseband, broadband etc.
• SMTP(Simple Mail Transfer Protocol): This is the internet standard for electronic mail.
• FTP(File Transfer Protocol): This enables a person to transfer files on the internet.
41
Transport Control Protocol(at layer 4-transport layer)
• TCP(Transport Control Protocol): This ensures reliable transfer of data from source to
destination. It breaks down message into packets and assigns them with sequence number
so that the message can be correctly reconstructed at the destination.
These are protocols that provide routing services. They handle addressing and routing
information, error checking and retransmission.. These protocols include:
• Internet Protocol(IP)-This does packet forwarding and routing using addressing systems
called IP addresses. Note: Each network on the internetwork(internet) has a unique IP
address.
• OSPF(Open Shortest Path First) protocol: This helps in efficient routing of data on internet as
it analyses all routes and chooses the one with least costs to transfer the packets.
Note: In networks, some devices work at networking level( i.e. they link nodes to a network) while
others work at internetworking level (i.e. they link a network to another network)
7 Gateway internetworking
6 Gateway internetworking
5 Gateway internetworking
4 Gateway internetworking
Note: Router and Gateway are both networking and internetworking devices.
• The Transmission Control Protocol (TCP)/ Internet Protocol(IP) model was developed to
enable internetworking on the internet.
42
• It combines the transport control protocol (TCP) and internet protocol(IP) into one. TCP/IP is
a set of protocols (including TCP) developed for the internet to get data from one network
device to another.
• Like OSI reference model, TCP/IP protocol model also has a layered structure only that
instead of 7 layers it has four(4) layers.
Below are layers of the TCP/IP protocol model from top to bottom:
4. Application layer
[Link] layer
2. Internet layer
• Note: The Application layer, Presentation layer and Session layer are combined into
Application layer in the TCP/IP protocol. The Data link and Physical layer are what makes the
Network interface layer of the TCP/IP model.
Session layer
iii. The network layer in OSI and the Internet layer in TCP/IP model perform same function
43
Differences between OSI model and TCP/IP model
a. OSI model has seven layers while TCP/IP model has four layers.
b. The Session, Presentation and Data link layers present in OSI model are missing in TCP/IP
model.
Note: Only those with permission are allowed to access information resources on the intranet.
Intranet is connected using TCP/IP protocols.
The following are methods that can be used to access the internet:
The telephone line has been one of the most widely used methods of connecting a network or
computers to the internet. Below are ways of connecting to internet via telephone lines:
a. Use of analog telephone lines that support dial up connections (circuit switched
connections):
Here you need to have a modem between computers to convert digital signals to analog
signals to be carried to the receiving end where there is another modem that demodulates,
converting analog signals back to digital signals to be handled by the computer.
This is a digital line that gives you permanent connection to internet(unlike the dial up).
In this case you do not need a modem as the line is already a digital signal carrier. However a
codec is required to control how bits are sent or received by the computers e.g. compressing
and decompressing a digital signal.
44
Mobile phone networks are capable of carrying both voice and data. Through wireless modems,
mobile phones (Smartphone) and tablets, you can tether them to computers (e.g. laptop) and
access internet via mobile networks.
This is the fastest method of accessing the internet since fiber optic cable carries huge
bandwidth. The subscriber simply applies to a service provider who comes and connects the
premise of the subscriber to the fiber network. E.g. GlobeMax provides fast internet to
companies.
Note: There are high initial costs but long run costs are cheaper (e.g. fast downloads)
• This uses small microwave transceivers to transmit and receive data signals both at the
service providers end and at the customer across distance of up to [Link] are
WiMax antaenas
45
Addressing System on Computer Networks
The internet is continuing to grow at a high rate such that many individuals, businesses, institutions
and others are increasingly connecting to the internet and are also using the world wide web(www)
as a platform for doing their businesses.
Note: All networks that are connected to the internet have a unique network number called Internet
Protocol (IP) number. As a general rule, every organization that has a network connected to the
internet is allocated only one IP address.
A. IP version 4(IPv4)
B. IP version 6(IPv6)
A. IP version 4(IPv4)
• This is the most common IP addressing system . It was the first to be created and it was
adopted widely.
• In IPv4 addressing system, each address is made up of 32 bits. The bits are separated into
groups of eights by periods. see below:
00000000.00000000.00000000.00000000
• Each group of eight bits can be converted to its decimal equivalent (i.e. from base 2 to base
10) to create a dotted decimal notation that is easy to read.
Remember: when converting to base 10 you use expanding method in which you multiply
each digit in smaller base i.e. base 2 by its position minus 1 and then add the results on each
position to get the decimal equivalent. See the calculation on next slide:
=0+0+0+0+0+0+0+0
=o
Structure of an IP address
46
• The leading part of the address which is called the Network number or Prefix. This number
is unique worldwide as it is used to identify each network.
• The remaining portion of the address is called the host number(i.e. A number that identifies
computers in the network)
E.g. [Link]
192.168.100 1
Internet addresses are divided into classes (Five classes). Designers of the addresses decided that for
easier identification of the network and for easier routing, the length of the network number should
be varied to differentiate the addresses into classes.
Note: The classes are based on the number of bits used for the Network ID( Network number) and
the host number.
i. Class A
ii. Class B
iii. Class C
iv. Class D
v. Class E
The first bit(i.e. highest order bit) of IP addresses in Class A is set at 0 and the network
number (Network ID) is made up of the first eight bits( 8bits). The twenty four bits (24 bits)
are used to identify host computers on the network.
e.g. [Link]
Network Number
Hosts Number
In this class of IP addresses, the first two highest bits start with 10 and the network number
(network ID) is made up of first sixteen(16) bits. The other 16 bits identify hosts.
47
e.g. [Link]
This class has the first three highest bits of the addresses starting with 110. The network number
is made of first twenty four(24) bits. The host number is made of last eight(8)bits. E.g.
[Link]
e.g. [Link]
This class has its first four bits set at 1110 . It is reserved for IP multicasting(i.e. sending to all
networks)
v. Class E addresses
This class has the first five bits set at 11110. This class is reserved for research purposes.(e.g.
research in networks and protocols)
Note: The first three classes (Class A, B and C) are called primary classes and they are classes in
commercial use all over.
Interpreting IP Numbers
48
Between 00000000 and 11111111 there are 256 numbers(i.e. 2n which is 28=256). The 255 in the
decimal notation comes because we count from 0. When this happens, it becomes 2n-1=28-1 which will
be 256-1 giving 255.
Note: The all zeros and all ones host addresses are reserved(i.e. are never given out).
The classful addressing has a limited number of unique network address numbers that could be
generated. In this case it is 232 which is 4,294,967,296 (since it uses 32 bits)
NOTE: At first it was never thought that this number of networks could not exist, but as internet grew
all this space neared exhaustion and it became difficult to register new networks on the internet.
This problem prompted(lead to) development of a different addressing scheme called Classless IP
addressing. After this development, there was development of new generation IP or the IPv6.
Note: In classful addressing, small organizations were allocated Class C address because in Class C,
the host number has only 8bits meaning 255-2=253 (remember the o and 1 are reserved). Large
organizations were allocated Class B (which has host field having 16 bits) while very large
organizations were allocated Class A (which has 24bits for hosts)
Note: 127 is not used in class A because it is used for loop back address. It is used as a local host to
test TCP/IP functionality.
Classless IP addressing
In CIDR there are no fixed boundaries between the octets(after every 8 bits) making the network
number and host numbers. Instead the IP addresses are assigned with a boundary of network
number and host number placed anywhere within the 32bit address. The router can be told where
the network number ends by including a /x at the end of the IP address . The x represents number of
bits making the network number.
49
IP Address Number of addresses per IP
a) In classful addressing, there is strict address layout specification for the network number and
host number for various classes while in classless, the number of bits used for the network
number and host number for the address varies according to the size of the network.
b) In classful addressing, the number of bits for the network and hosts is determined by the
class of the address, while as in classless addressing ,the number of bits that specifies the
network number is specified following a forward slash. e.g. [Link]/8
c) Classful addressing bring order in the way network numbers are allocated unlike the classless
addressing which is not orderly because the network and hosts can take on an
arbitrary(random) number depending on the size of network hence increasing routing costs.
B. IP version 6(IPv6)
This is a new generation of Internet addressing that has succeeded the IPv4.
The IPv6 uses 128 bit addresses as such it has bigger address space to accommodate more
networks. i.e.
• IPv6 consists of 8 groups of hexadecimal digits ranging from 0 to F separated by full colons.
See the example below:
[Link]
Note: The leading zeros (i.e. zeros in front of non-zero numbers) are omitted. With this fact
the number above will be:
[Link]
iii. It is possible to have abbreviations. For example, leading zeros in contiguous blocks(adjacent
blocks)are represented by double colons(::)
50
Binary Decimal (base 10) Hexadecimal
0000 0 0
0001 1 1
0010 2 2
0011 3 3
0100 4 4
0101 5 5
0110 6 6
0111 7 7
1000 8 8
1001 9 9
1011 11 b
1100 12 c
1101 13 d
1110 14 e
1111 15 f
Steps:
51
• first group the digits i.e 1100 1111
e.g. [Link]/48 means the first 48 bits are for the network number while the remaining
(80bits) are the host bits.
The :: at the end represents the remaining blocks are all zeros.
IP configuration on Networks
After connecting your computer to a network using transmission media, you need to configure it in
order to be able to communicate with other computers on the local network and also to access the
internet.
52
NETWORK APPLICATIONS
Networks are being used to provide a number of services nowadays. Previously people used to send
and receive messages through ordinary mail commonly known as snail mail (as it was slow). Today
people are using most efficient modes of communication such as mobile phones and the Internet.
A web: refers to a set of related hypertext (interlinked) documents that contain text, images and
video.
A Webpage: is a single document page connected to the World Wide Web containing text and
other items that can be viewed by everyone connected to the internet using a web browser. A
webpage is basically a file written in a language called Hypertext Mark-up Language (HTML)
containing text, images, video e.t.c
A Website: is an addressed location that consist of a collection of related web pages hosted on
one or more computers linked together in a particular way.
Web browser: is a special program that is used to view information on web pages on the
Internet.
A web browser allows you to see contents on web pages such as text, images or videos. It also
allows you navigate between web pages using hyperlinks.
Examples of popular web browsers are:
Google chrome
Opera
Microsoft internet explorer
Mozilla Firefox
Purpose of web browser:
Connecting to web servers
Requesting web pages
Properly formatting the web pages and displaying them to the user
Note: a Hyperlink is a link from a hypertext file to another file that is activated by clicking on the
highlighted word or icon. It helps you navigate from one page to another webpage.
Hypertext document: is a web page that has links to the same page or other pages on the web.
Clicking on a link in a hypertext document takes you from a current page or section to another.
53
Note:To ensure easy access to information or resources on a website, each website has a unique
address called a uniform resource locator (URL).
The URL is the unique address of a webpage on the World Wide Web that provides access to the
required resource on the website or webpage.
e.g. to visit a site such as Google you type the URL [Link]
1. The protocol governing how to get the information e.g. HTTP( Hypertext Transfer
Protocol)
2. The Internet Host name of the computer where the required content or resource is
stored [Link]
3. The directory or location on the site where the content or resource is located. This
usually follows the forward slash. See below
[Link]
Note: HTTP (Hypertext Transfer Protocol) is a protocol that uses TCP to transfer hypertext requests
and information between servers and browsers.
Search engine: is a special site or special type of website that helps users search and easily find
information from other websites. It is basically a website that searches for content in other
websites.
Note: there is vast amount of information on the web such that it sometimes becomes
frustrating to users when they cannot get information they need. A solution becomes to use a
search engine to search for the required content from various websites.
Examples of search engines include Yahoo, Google, Bing, Excite, Alta Vista
54
iv. The results and time takes to search for the requested item are displayed on the web
browser.
Homepage (also known as website Index): is the first page for a website. Note: the homepage is
mostly loaded to be used for navigation to other pages or other websites.
Web Server: is a computer on a network or intranet that delivers web pages and other files in
response to the web browser’s request.
Internet Services
Internet services are services offered on the internet (i.e. offered online).
Examples of Internet services include the following:
A. World Wide Web (www)
B. Electronic mail (e-mail) and fax
C. Instant messages
D. Electronic commerce
E. Electronic learning (e-learning)
F. Newsgroups
G. File transfer protocol (FTP)
C. Instant Messages
This is a more improved messaging service that allows two or more people to
communicate directly in real time. Here you must register with an instant messenger e.g.
Whatsapp
Yahoo messenger
55
Google+
F. Newsgroups
These are organised groups of Internet users who wish to share ideas and interests. To
participate one has to join a newsgroup then he or she can contribute to discussions. E.g.
Times online news, zodiac online etc.
Understanding the web address (also called Uniform Resource Locator [URL])
The general format of the URL is as below:
[Link]
wherehttp is the Protocol, [Link] is the domain-name and .[Link] is the top level
domain
The protocol: This is the rule that defines how to access the required resource. The two
common examples of protocols that work on Internet are the http:// (Hypertext transfer
protocol and File transfer protocol (FTP). The http is a standard used for accessing a website
content from server and submitting it to a web browser. FTP on the other hand is a standard
used for uploading content to a server and downloading of content from the web server.
Domain name: This is the name of the server or computer where the website or the
required resource is located or kept on the Internet. E.g. [Link] is a domain or
resource name located in www directory.
56
Top level domain: This represents or indicates the type of service offered by the
organisations. For example .[Link] means that this is an academic institution located in
Malawi.
Below are some of the commonly used top level domains and the type of organisations they
represent
Note: some top level domains also have two letter extension added after the business domain part
to indicate the country in which the business or the site is located. e.g. [Link] see below
EXTENSION COUNTRY
.mw Malawi
.ke Kenya
.uk United Kingdom
.ug Uganda
.tz Tanzania
.au Australia
.jp Japan
Use of Hyperlinks
Hyperlinks are links used to navigate from one webpage to another page or one section to
another. To use a hyperlink:
i. Move mouse pointer on the link. It will change to a pointing finger
ii. Click the hyperlink to jump to the required page or part specified by the link
Navigation Toolbar
You can also move from one part of website to another using buttons on the navigation tool bar
provided by the web browser. i.e. back, forward, refresh etc.
Below are the icons on the toolbar and their function:
57
Stop This stops loading of the current webpage
Refresh This is used to reload a webpage
Search box This is a shortcut for searching information using Google search
engine
Home Takes the user to the homepage or index page of the website
Download Used to download the current webpage
Bookmark Used to bookmark a webpage (i.e. to save a link to a website
address in a web browser that will be used to facilitate quick
access to the website when you need it again)
History Displays a list of recently visited web pages
Printing a Webpage
1. Click File menu then click Print OR press Ctrl + P
2. Set the Print properties you want e.g. copies, paper size etc.
3. Click Ok to start printing the web page
Note: Web-based email accounts provide access to email services from anywhere as long as you have
a computer or mobile phone that has access to internet.
58
Creating a new e-mail message
Format of a standard e-mail message
A standard e-mail message has a format with the following:
1) Header information
The e-mail header has the following sections:
a. Address: This provides a textbox where you enter the e-mail address of the
recipient.
b. Subject: This specifies the content of the message in the message body.
c. Attachment: This is where you can add other files to accompany the e-mail
message such as documents, photo, and video to send via e-mail.
2) Message body
This is where you type the message you want to send mostly text.
3) Signature
This part provides additional information about the sender such as full name or
telephone number.
To compose an e-mail message:
i. Click New or Compose e-mail button
ii. Type the recipient e-mail address
iii. Type the subject of the message e.g. Annual Meeting Notice
iv. Type your message and attach any files if needed e.g. photos or video (less than
25mb)
v. Click Send button
Managing Contacts
To avoid errors when typing e-mail addresses, add contacts in the address book. To do this
click add to contacts link.
Social networking
Another example of network application is social networking.
Social networking refers to creation of social relationships to interact with other people on
social networks by uploading and downloading media content.
Social networking has helped people link or connect with their classmates, teachers, college
mates e.t.c. via various social networks. Social networking has been made possible by social
networks such as Facebook.
59
Social networks are web-based sites that allow individuals to create a public profile to
share information with people they share interests, activities, backgrounds or real-life
connections.
Examples of Social networks
Facebook
Twitter
Whatsapp
Linked-in
Social media: refers to the content that people upload on social network sites. e.g. music,
videos, photos e.t.c.
1. Global connections: social networks have helped people to make new friends and
stay in touch with them globally.
2. Marketing: social networks are being uses to advertise goods and services even
beyond borders.
3. Promotion of technology use: social networking uses accessible technologies like
mobile phones, computers and internet and this has motivated people to embrace
and use such technologies.
4. Social cohesion: social networks help people keep in touch (in contact) with their
family members in cases where physical meeting is impossible.
5. Career opportunities and employment opportunities: social networking has
simplified job searching. People now share job vacancies on social networks such as
Whatapp groups and Facebook pages.
6. Political campaigns: social networking has also become a powerful tool during
political campaigns. Politicians share their manifesto to the public and build support
for them.
7. Security: security detectives also sniff into media content to track down cases of
organized crime and terrorism.
8. Promotion of Health and wellbeing: social networking has been helpful to people in
obtaining medical/ health information from doctors and other medical experts. e.g.
how to cook health diets, how to prevent infections.
60
b) It has reduced face to face connections
Social networking has reduced the need for physical social interaction between
people. People sometimes get glued to their mobile phones during social meeting
such as birthday parties.
Warning: You must always exercise caution (care) before joining social networking sites.
A. Distributed systems
61
This refers to geographically separated networks of different computers and applications
(software) that are using shared resources.
Internet
62
Site 3: Mzuzu Main Branch
ii. intranet
This is a subset of internet that is privately administered by an organisation to ensure
access to organisation’s services and information.
For example, a Banks intranet provides a real –time access to the Bank’s customer
database any time of the day. The Bank’s employees can carry out some other tasks
while at home using computers and mobile phones e.g. updating customer records.
C. Distributed application
This is an application program that is distributed across several Servers in a
distributed system.
Below are some examples of distributed applications and services:
Online flight-reservation application: This application enables real-time
booking and payment for flights.
63
Distributed cash dispensing machine application: This application enhances
access to cash withdrawals and deposits through ATMs.
64
video conferencing. These have enabled people to work together on a project
thereby improving productivity.
Self-test questions
1. Define a computer network (1m)
2. Describe any four types of computer networks(6m)
3. With the aid of labelled diagrams describe any three types of network
topologies(9m)
4. Give and explain any four uses of networks(8m)
5. Explain briefly any four benefits of networks(8m)
6. Explain any four limitations/disadvantages of networks(8m)
7. Give and describe five elements of a communication system(10m)
8. Give two broad categories of communication network devices(2m)
9. Define the following terms:
a. Data signal(1m)
b. Amplitude (1m)
c. Signal modulation(1m)
d. Signal demodulation(1m)
e. Multiplexing(1m)
f. Bandwidth(1m)
g. Attenuation(1m)
10. Give and explain three classes of communication networks(6m)
11. Give one major disadvantage of packet switching.(1m)
12. Give and describe two categories of data communication media(4m)
13. Give and briefly describe any three types of physical data transmission media(6m)
14. With the aid of labelled diagrams describe the difference between Shielded twisted
pair cable(STP) and Unshielded twisted pair cable(UTP) (6m)
65
15. Give one major advantage and one major disadvantage of twisted pair cables.(1m)
16. Give any two advantages of fibre optic cables over coaxial and twisted pair
cables(2m)
17. Give any three types of wireless transmission media.
18. Give any two advantages or wireless communication systems over wired
communication systems (2m)
19. State one major disadvantage of wireless communication systems(1m)
20. Describe the following data transmission modes:
a. Parallel transmission mode(1m)
b. Serial transmission mode(1m)
c. Simplex transmission mode(1m)
d. Half-duplex transmission mode(1m)
e. Full duplex transmission mode(1m)
66
43. Define “Distributed systems”(2m)
44. Give and describe any four examples of distributed systems and services(8m)
45. Explain any three responsibilities of distributed systems(6m)
46. Give and explain any three advantages and three disadvantages associated with
distributed systems.(12m)
67