SS 2 DATA Processing Second Term
Data Processing (Federal Science and Technical College)
Scan to open on Studocu
Studocu is not sponsored or endorsed by any college or university
Downloaded by RUKAYAT HASHIM 0405
GOVERNMENT GIRLS’ SCIENCE AND TECHNICAL COLLEGE
POTISKUM
DATA PROCESSING
LESSON GUIDE
For SS II
Prepared by:
Musa Datti
Zakar
Edited by: Suleiman Salisu
Ibrahim
October, 2021
1 | DATA PROCESSING Lesson
Note
Downloaded by RUKAYAT HASHIM 0405
SS2Data Processing SECOND TERM
SCHEME OF WORK
WEEK TOPIC
1 Writing of scheme of work/Revision
2-3 ENTITY-RELATIONSHIP MODEL
· Definition of terms: entity, entity instance,
entity set, attribute
· Types of attributes
· Relationship
· Degree and Cardinality of a relationship
3-6 RELATIONAL MODEL
· Definition of terms: relation, attribute,
tuple, domain, degree, cardinality, relational
scheme.
· Types of relational keys
· Creating and modifying relation using SQL
7 FILE ORGANIZATION
· Definition of file organization
· Types of file organization method
· File access method
· Types of file access method
8 INTERNET
· Definition of Internet
· Benefits of the internet
· Abuse of the internet
· Internet security
9 OPERATING SYSTEM
• Definition of Operating system
• Types of operating system
2 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
• Examples of operating system
• Functions of operating system
• Operating system interfaces
TOPIC 1: ENTITY - RELATIONSHIP MODEL
An entity-relationship model describes data in terms of the
following:
1. Entities
2. Relationship between entities
3. Attributes of entities
ERM is graphically represented using an entity-relationship diagram
(E-R Diagram).
Entity relationship diagram
Entity: An entity is an object that exists and which is
distinguishable from other objects. An entity can be a person, a
place, an object, an event, or a concept which an organization
wishes to maintain data. The following are some examples of
entities:
Person: STUDENT, EMPLOYEE, CLIENT
Object: COUCH, AIRPLANE, MACHINE
Place: CITY, ROOM, WAREHOUSE
Concept: PROJECT, ACCOUNT, COURSE
3 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
An entity type defines a collection of entities that have same
attributes. An entity instance is a single item in this collection.
An entity set is a set of entity instances. For example, STUDENT is
an entity type; a student with ID number ISI070 is an entity
instance; and a collection of all students is an entity set.
In E-R diagram, an entity name should be a concise singular
noun that captures the unique characteristics of the entity type. An
E-R diagram depicts an entity type using a rectangle with the name
of the entity inside, as shown below.
Attribute: An attribute is a characteristic of an entity type. Some
attributes of common entity types include the following:
STUDENT = {Student ID, Name, Address, Phone, Email, DOB}
ACCOUNT = {Account Number, Account Type, Date Opened,
Balance}
The diagram below indicates some of the possible attributes in an E-
R diagram for the entity STUDENT.
4 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
Types of attributes
1. Simple or an atomic attribute, such as City or State, cannot be
further divided into smaller components.
2. Composite attribute can be divided into smaller subparts in
which each subpart represents an independent
attribute. Name and Address are the only composite attributes in
the diagram above.
3. Single-valued attribute: most attributes have a single value. For
example, a student has only one date of birth and one identification
number.
4. Multi-valued attribute: have more than one value for an entity
instance. For example, student attribute language above, which
stores the name of languages a student can speak, is a multi-valued
attribute.
5. Stored attribute is an attribute whose value cannot be derived
from the values of other attributes.
6. Derived attribute: the value of a derived attribute can be
determined by analyzing other attributes. For example, in the figure
above, Age is a derived attribute because its value can be derived
from the current date and the attribute DateofBirth.
7. A key attribute (or identifier) is a single attribute or a
combination of attributes that uniquely identify an individual
instance of an entity type. No two instances within an entity set can
have the same key attribute value. StudentID is the key attribute in
the picture above.
Relationship
5 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
Entities in an organization do not exist in isolation but are related to
each other. Students take courses and each STUDENT entity is
related to the COURSE entity. Faculty members teach courses and
each FACULTY entity is also related to the COURSE entity.
Consequently, the STUDENT entity is related to the FACULTY
entity through the COURSE entity. In an E-R diagram, we represent
relationship types with diamond-shaped boxes connected by
straight lines to the rectangles that represent participating entity
types. A relationship type is a given name that is displayed in this
diamond-shaped box and typically takes the form of a present tense
verb or verb phrase that describes the relationship. A relationship is
an association among several entities. The figure below is an E-R
diagram that shows a relationship between entities ACCOUNT and
CUSTOMER.
Degree of a relationship
The number of entity sets that participate in a relationship is called
the degree of relationship. The 3 most common degrees of
relationship are unary (degree 1), binary (degree 2) and ternary
(degree 3).
Unary relationship: A unary relationship exists when there is an
association between two instances of the same entity type. For
example, in an organization, an employee will manage one or more
employee.
6 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
Binary relationship: A binary relationship exists when there is an
association between two instances of two different entity types. For
example, in a secondary school, a binary relationship exists between
a Subject (SUBJECT entity) and a Teacher (TEACHER entity); a
teacher teaches (a) subject.
Ternary Relationship: A ternary relationship exists when there is
an association between three instances of three different entity
types. For example, consider a student using certain equipment for a
project. In this case, the STUDENT, PROJECT, and EQUIPMENT
entity types relate to each other with ternary relationships: a student
checks out equipment for a project.
Cardinality of a relationship
The cardinality is the number of occurrences in one entity which are
associated (or linked) to the number of occurrences in another
entity. For example, if the entity types A and B are connected by a
7 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
relationship, then the maximum cardinality represents the
maximum number of instances of entity B that can be associated
with any instance of entity A. There are three types of relationship:
1. One-to-One Relationship: In a one-to-one relationship, at most
one instance of entity B can be associated with a given instance of
entity A and vice versa. For example, an employee is assigned a
parking space or an employee manages the department.
2. One-to-Many (or many-to-one) Relationship: In a one-to-many
relationship, many instances of entity B can be associated with a
given instance of entity A. However, only one instance of entity A
can be associated with a given instance of entity B. For example,
many employee works in a department or a school has many
employees.
3. Many-to-Many Relationship: In a many-to-many relationship,
many instances of entity A can be associated with a given instance
of entity B, and, likewise, many instances of entity B can be
associated with a given instance of entity A. For example, many
employees work on many projects.
8 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
TOPIC 2: RELATIONAL MODEL
A relational model gives a simple way of representing data in form
of a two-dimensional table called relation. Relational model was
invented by Edger Codd. The columns or fields in the table identify
the attribute such as surname, lastname, age, gender, Admission
number etc. A tuple or row contains all the data of a single instance
of the table such as a person named James Bond. In the relational
model, every tuple must have a unique identification or key based
on the data. In the table below, the Admission number is the key
that uniquely identifies each tuple in the relation. Keys are often
used to join data from two or more relations based on matching
identification. Another concept used in a relational model is the
foreign keys, which are primary keys in one relation that are kept in
another relation to allow for the joining of data.
Definition of terms
1. Field: is a named column in the relation (table). There
are five fields in the student relation above – Admission
number, Surname, Last name, Age, Gender.
2. Tuple: is a record (i.e. a row of data in a relation). All
tuples in a relation must be distinct.
9 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
3. Domain: is defined as the set of all unique values
permitted for an attribute. For example, the domain of the field
Gender as seen in the table above is M and F. Also, the domain
of the
attribute Surname consists the combination of all possible letters in
the alphabet. A domain is referred to in a relation schema by the
domain name and has a set of values.
4. The Degree (also called arity) of a relation is the number of
fields in it. The relation above is of degree 5.
5. The cardinality of a relation is the number of tuples in it.
For example, the relation above contains 6 tuples and hence the
cardinality is 6.
6. A relational database is a collection of relations with
distinct names that can be linked together.
7. Relation schema describes the column heads of the table.
The schema specifies the relation’s name, the name of the field (or
attribute or column) and the domain of each field. For example,
the schema for the Student relation above is given below:
Student (Admission number: integer, Surname: string, last
name: string, Age: integer, Gender: string).
Relational model keys
1. Candidate key: Candidate keys are defined as the minimal set
of fields which can uniquely identify each record in the table. It is
an attribute or a set of attributes that can act as a primary key for a
table to uniquely identify each record in that table.
2. Primary key: is any candidate key that is most appropriate to
be the main reference key for the table. It is used to establish
relationship with other tables. It must never be null and must be
unique.
10 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
3. Foreign key: is generally a primary key of one table that
appears as a field in another where the first table has a relationship
with the second. In other words, if we have a table A with a primary
key X that is linked to a table B where X is a field in B, then X is a
foreign key in B.
4. Secondary key or alternative key: a table may have one or
more choices for the primary key. Collectively these are known as
candidate keys as shown above. One is selected as the primary key.
Those not selected are known as secondary keys or alternative keys.
5. Composite key is combination of two or more columns in a
table that can be used to uniquely identify each row in a table
CREATING AND MODIFYING RELATION USING SQL
MS-Access, a relational DBMS typically provides a Graphical User
Interface (GUI) that allows the creation of a database and tables that
store information about different subject. This can be achieved
using a query language called SQL (Structured Query Language). A
subset of the SQL that is used to define the structure of the database
and the table is called data definition language (DDL). In SQL, a
relation is a table.
Creating a database using SQL
The syntax is as follows:
CREATE DATABASE databasename;
The “CREATE DATABASE” is the keyword and “databasename”
is the name of the database.
11 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
For example, assuming we want to create a database for students’
information, then the create statement would be as follows:
CREATE DATABASE StudentDB;
Note: Use the Commands:
SHOW DATABASES; - to see the list of databases in the DBMS
DROP DATABASE database_name; - to delete a database
from a DBMS
Creating relation (Table) using SQL
The syntax is as follows:
CREATE TABLE table_name
( Column1 datatype,
Column 2 datatype,
Column3 datatype,
.....
columnN datatype,
PRIMARY KEY (one or more columns)
);
MODIFYING RELATIONS USING SQL
Querying Database: You query the database when you are
requesting for certain information from the database. You can
12 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
include condition that such items you want should meet. The query
helps us retrieve data from the database.
In its simplest form, a query consists of two parts:
· A SELECT list, where the columns to be retrieved are
specified
· A FROM clause, where the table or tables to be accessed are
specified
Example
The following SQL statement selects the entire rows of data from
the StudentTbl:
SELECT * FROM StudentTbl
It is also possible to specify certain columns to be retrieved from the
StudentTbl.
TOPIC 3: FILE ORGNIZATION
File organization refers to the logical relationships among various
records that constitute the file, particularly with respect to the means
of identification and access to any specific record. In short, it refers
to the way in which data records are stored or arranged.
Types of file organization
1. Serial (heap) files organization: records are placed in the order in
which they are inserted. A new record is inserted in the last page of
the file; if there is insufficient space in the last page, a new page is
added to the file.
13 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
2. Sequential file organization: records are stored in some sort of
order (ascending, descending or alphabetical) based on the unique
key field or search key. This method is fast & efficient for huge
amount of data.
3. Index Sequential Access Method (ISAM): Records are organized
in sequence and an index table is used to speed up access to the
records without requiring a search of an entire file. This type of file
organization is best suited for situations where both batch and
online processing are to be supported.
4. Direct or Random file organization: In this file organization,
records are organized in such a way that it is possible for the
computer to directly locate the key of the desired record without
having to search through a sequence of the record. Direct file
organization allows direct access to individual records stored in any
part of the file. These types of files are used in direct access storage
device (DASD) like floppy disk, hard disk and optical disk.
File access
When a file is used, information is read and accessed into computer
memory and there are several ways to access this information of the
file. The file accessing methods are:
1. Direct access: the information/data stored on a device can be
accessed randomly and immediately irrespective to the order it was
stored. For example, hard disk, flash drive etc.
2. Sequential access: the information/data stored on a device is
accessed in the exact order in which it was stored i.e. one record
after another e.g. magnetic tape.
14 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
TOPIC 4: INTERNET
The Internet is the global system of interconnected computer
networks that uses the Internet protocol suite (TCP/IP) to link
billions of devices worldwide. No one owns the internet, although
several organizations collaborate in its functioning and
development.
BROWSER
A browser or a web browser is application software with a
graphical user interface for displaying HTML files, used to navigate
the World Wide Web. Technically, a Web browser is a client
program that uses HTTP (Hypertext Transfer Protocol) to make
requests of web servers throughout the Internet on behalf of the
browser user. Examples include Mozilla Firefox, Applesafari,
Opera, lynx (a non-graphical browser), Flock, Microsoft Internet
explorer, Netscape Navigator, UC browser, Google chrome, etc.
Benefits/advantages of the internet
· Allow access to vast range of information
· Allow the storing of electronic information in the cloud
· E-commerce: buying online has been made possible
through the internet
15 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
· Worldwide media accessibility: internet radio, internet
TV, etc.
· News, of all kinds is available almost instantaneously.
· Online banking
Abuse of the Internet
· Pornography – watching X-rated films on the internet
· Fraud: Fraudulent activity involves any attempt to unlawfully
obtain money, information or resources from unsuspecting users
within a network.
· Plagiarism – somebody’s electronic content can be
plagiarized without due reference or permission
· Lack of control – the level of information available on
the internet is often not controlled.
· Virus - internet users are prone to downloading virus
and other malicious program when downloading software from
illegitimate website on the internet.
· Hacking: Having unauthorized access to peoples computer
on the internet
Internet security
Internet security objective is to establish rules and measures to use
against attacks over the Internet. Generally, Internet security
encompasses browser security, the security of data entered through
a Web form, and overall authentication and protection of data sent
via Internet Protocol. The following are various security threats:
• Malicious software (malware): A computer user can be tricked
or forced into downloading software onto a computer that is of
16 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
malicious intent. Such software comes in many forms, such as
viruses, Trojan horses, spyware, and worms.
• Denial of service attack: A denial-of-service attack (DoS
attack) or distributed denial-of-service attack (DDoS attack) is
an attempt to make a network resource unavailable to its
intended users.
• Phishing: Phishing occurs when the attacker pretends to be a
trustworthy entity, either via email or web page. Victims are
directed to fake web pages, which are dressed to look
legitimate, via spoof emails, instant messenger/social media or
other avenues.
• Rootkits: this is a collection of software tools that enables
remote control and administration-level access over a
computer or computer networks. Once remote access is
obtained, the rootkit can perform a number of malicious
actions; they come equipped with keyloggers, password
stealers and antivirus disablers
• SQL injection attack: are designed to target data-driven
applications by exploiting security vulnerabilities in the
application’s software.
The following tips can guard internet users against security threats:
• Use complex and strong passwords always on the internet: a
complex password involves a combination of alphabets (both
capital and small letters), numbers and special characters e.g.
P@$$w0rd.
• Use computer firewall to monitor and control incoming and
outgoing network traffic based on predetermined security
rules.
• Antivirus should be installed and must be periodically updated
to guard against virus and other malicious software threats
17 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
• Ensure that the choice of browser is that which has less
vulnerability. Vulnerability in browser can be reduced by
using updated browser app.
• Avoid clicking links or attachments from unknown sources
• Encryption: data being sent over the internet can be encrypted
in a form that only the recipient can decrypt using a known
key.
• Ensure visiting websites with secure protocol i.e. https
TOPIC 5: OPERATING SYSTEM (OS)
Operating system (OS) is the system software that controls,
manages, coordinates, supervises computer hardware resources and
provides common services for computer programs.
It is a collection of programs that coordinates all the functions and
activities of the computer hardware components as well as act as an
interface between the computer user and the computer hardware.
Types of operating system
1. Batch processing OS: a program takes a set of data files (in
batches) as input, processes the data and produces a set of
output data files. Each batch is processed as a unit, hence the
name ‘batch processing’.
2. Multi-programming OS: this operating system allows end-
user(s) to run more than one program at a time. The central
processing unit of the computer switches between two or more
running tasks (jobs) held in a partitioned memory.
3. 3Time sharing (or multi-tasking) OS: the OS allocates the
CPU to several users (at various terminals) in a time slots. For
example, a Mainframe computer that has many users logged
on to it and switching the CPU among multiple users.
18 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
4. Multi-processing OS: refers to the use of two or more CPUs
within a computer system. The multiple CPUs are in a close
communication sharing the computer bus, memory and other
peripherals.
5. Network OS: this OS runs on servers and provides the server
the capability to manage data, users, groups, security,
applications and other networking functions.
6. Real time OS: the OS is used on data processing systems in
which the time interval required to process and respond to
inputs is so small that it controls the environment. This OS is
used in scientific experiments, medical imaging systems, air
traffic control system etc.
7. Distributed OS: this is an OS over a collection of
independent, networked, communicating and physically
separate computational nodes. Each individual node holds a
specific software subset of the global aggregate OS.
8. Embedded OS: is a specialized OS for use in the computers
built into larger systems. An embedded system can also refer
to the use of software and electronics with a dedicated purpose
within a larger system. Examples of embedded systems are
MP3 Player, Calculator, Remote control, video game console,
Digital alarm clock etc.
Operating systems can also be seen as a:
1. Single-user, single task OS: this type of OS is designed to
manage the computer so that the user can effectively do one thing at
a time. The Palm OS for Palm handheld computer and Microsoft
Disk Operating System (MS-DOS) are good examples of single-
user, single task OS.
19 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
2. Single-user, multi-tasking OS: this OS allows a single-user
to run several programs at the same time. They are common on
desktops, laptops and even latest mobile phones. For example, it’s
entirely possible for a Windows user to be typing in a word
processor, while downloading a file from the internet and printing
the text of an email message.
3. Multi-user OS: this OS allows many users to take advantage
of the computer’s resources simultaneously. UNIX, Xenix, Virtual
Memory System (VMS) are examples of multi-user operating
systems.
Examples of operating systems
1. UNIX 4. Linux
2. Microsoft Windows 5. Mac OS
3. OS/2 6. Solaris
The examples below are for mobile devices
1. Android 2. iOS 3. Blackberry OS 4. Symbian OS
FUNCTIONS OF THE OPERATING SYSTEM
1. Task management: the OS controls the focus (where the
attention is at any given time) by giving control to the program the
user brings to the foreground.
2. Job management: the OS controls the order and time in which
programs are run. An example is when multiple print commands is
sent to the printer, the OS spool the content and schedule which one
prints first in a first come first served (FCFS) approach.
20 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
3. Memory management: the memory manager, a part of the OS
manages the limited memory by allocating and de-allocating
memory space as required by programs.
4. File management: this function allows the OS to read, write and
modify data while managing the logical storage of the data using a
file system. Examples of file systems are FAT, FAT32, NTFS, HFS,
HFS+, JFS etc. File system is important for a well file organization
and faster access time.
5. Device management: the device management function controls
hardware devices by using special software called device driver,
which is installed upon connecting the particular device to the
system unit of the computer.
6. Booting: the OS manages the starting up of the computer
7. Loading of data and programs from disk to main memory for
execution
8. Controls hardware resources
9. Security: by means of password and other similar techniques
(biometrics, patterns etc.) the OS prevents unauthorized access to
programs and data.
10. Act as an interface between user and the computer hardware.
21 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
OPERATING SYSTEM INTERFACES
The interface refers to the medium through which the users and
application programs communicate with the OS. The two levels are:
1. Command line interface (also called The shell or CLI): this
interface enforce that you type the exact command you want to
execute. No icon can be clicked here. The common example is MS-
DOS
2. Graphical User Interface (GUI): this interface allows users
to have direct control of the visible graphical objects (icons) and
actions (menu) that replaced command syntax. These icons
represent files, disks, programs and other objects. Examples are
Windows OS, Linux and Mac OS.
The components of the GUI are:
a. Pointer: This appears as a small angled-arrow or a capital I in
text processing applications
22 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405
b. Icon: these are small pictures that represent commands, files
or drives.
c. Windows: a typical icon turns to a window upon opening.
This can be resized, moved, minimized etc.
d. Menus: most GUI interfaces let you execute commands by
selecting a choice from a menu.
e. Desktop: the area on the display screen where icons are
grouped.
23 | DATA PROCESSING Lesson Note
Downloaded by RUKAYAT HASHIM 0405