You are on page 1of 33

SS2 DATA PROCESSING

Second Term Scheme of Work

WEEK TOPIC
1-2 *Revision of last term’s work.
File Organization
* Types of file organization
*Comparison of Three file organization
3 Internet 1
*Definition of internet
*Internet browsers
*Benefits of internet
4 Internet II
*Internet Security
*Abuse of the Internet
*Internet services
*Internet basic terms

5 DATA MODEL
*Definition of Data model
*Types of data model
* Approaches to data mode
*Creating Tables
*Creating forms, Queries and Reports
*Significance of data model

6 NORMAL FORM
*Definition of Normalization
*Goals of normalization
*Types of normal forms
7 ENTITY-RELATIONSHIP MODEL
*Definition of terms
*Types of attributes
*Relationship
8 RELATIONAL MODEL

9-10 REVISION
11 END OF EXAMINATION
WEEK 1 & 2

File Organization

OBJECTIVES

At the end of the lesson, I should be able to:

i. Define file organization


ii. State the functions of file
iii. Types of file organization
iv. Methods of accessing files
v. File classifications/types
vi. Criteria for classifying files
File Organization

The term "file organization" refers to the way in which data are stored in a file and, consequently, the
method(s) by which it can be accessed.

File Functions:
Files are used to do one or more of the following functions:

a.   Provide machine executable code


b. Store application program or operating system configuration
c.   Store data used by user such as Microsoft Word files.
Therefore there are three types of information that files contain:
i.   Executable code
ii. System or program configuration file
iii. User data
3.  Record: A record is a collection of fields. In computer science, a record (also
called struct or compound data) is a basic data structure.
4.  Field: Field is a single piece of information about and object.  A is also defined as a space that
holds specific parts of data from a set or a record. Examples of fields are NAME, ADDRESS,
QUANTITY, AGE, etc.
5.  Data element: A data element is the logical definition of field

6.  Data item: Data item is the actual data stored in the field
Types of Data Items

Each data element consist only a single item. These items will have one of the three basic types:
numeric, alphabetic and alpha-numeric.

Numeric data: Data consisting of digits and not letters of the alphabet or special characters.

Alphabetic data: Data consisting of letters and not digits or special characters.

Alpha-Numeric data: Data consisting of digits, alphabets as well as special characters.

File organization Terms

a.  Block: A block is the physical unit of transfer between the backing store and the main memory.
b. Bucket: A bucket is the logical unit of transfer between the backing store and main memory.
c.   Hit: In processing a record that is required is called a hit.
File Organization Structure
Types of File Organization
There are mainly four types of file organization:
1.  Serial file organization
2.  Sequential file organization
3.  Index file organization
4.  Random file organization
Serial file organization
Serial files are stored in chronological order that is as each record is received it is stored in the next
available storage position.  In general it is only used on a serial medium such as magnetic tape.
Sequential file organization
Sequential files are files whose records are sorted and stored in an ascending or descending on a
particular key field.
Index file organization
An index is an alphabetical list of names, subjects, etc., with references to the places where they
occur. Indexed Sequential file organization is logically the same as sequential organization, but an
index is built indicating the block containing the record with a given value for the Key field.
Random file organization
A randomly organized file contains records arranged physically without regard to the sequence of the
primary key.  Records are loaded to disk by establishing a direct relationship between the Key of the
record and its address on the file, normally by use of a formula (or algorithm) that converts the
primary Key to a physical disk address.  This relationship is also used for retrieval.
Methods for Accessing Files
Files can be accessed:
a.   Serially
b. Sequentially and
c.   Randomly
File Classification
Files are classified as follows;
a.   Transaction Files: transaction files contains details of all transactions that have occurred in the
last period. Examples of transaction files are price of the products, customers order for the
products, inserting new data to the database etc.
Features of transaction file

1.  The data stored in these files are temporary by nature

2.  This file contains data only for period of time and send to the master file

3.  Any data to be modified is done in this file

4.  In this file the data to be modified is stored.

b. Master  Files: Master file are permanent file kept up-to-date by applying the transactions that
have occur during the operation of the business
Features of transaction file
1.  The data stored in these files are permanent by nature
2.  This file is empty while nature  
3.  This files are updated only through recent transactions
4.  This file stores large amount of data
c.   Reference Files:  Reference file is a type of master file containing referential data.  It contains data
that are necessary to support data processing. E.g. price lists, dictionary files, present value
schedules, amortization.
Criteria for File Classification
1.  How the file is to be used
2.  How many records are processed each time the file is updated?
3.  Whether the individual records need to be quickly accessible
4.  Nature of content
5.  Organization method
6.  Storage medium

Comparison between the Three Files Organization


We now compare the cost of some simple operations for three basic file organizations such as:
i. Files of randomly ordered records
ii. Files sorted in sequence of fields or heap files
iii. Files that are hashed on a sequence of fields.
The three files above can be compared under the following;

Scan: Fetch all records in the file. The pages in the file must be fetched from the disk into the buffer
pool. There is also a CPU overhead per record for locating the record on the page.

Search with equality selection: Fetch all records that satisfy an equality selection, for example, find
the student record for the student with sid 23. Pages that contain qualifying records must be fetched
from the disk, and qualifying records must be located within retrieved pages.

Search with range selection: Fetch all records that satisfy a range selection. For example, find all
students records with name alphabetically after smith.

Insert: Insert a given record into the file. We must identify the page in the file into which the new
record must be inserted, fetch that page from the disk, modify it to include the new record and then
write back the modified page.

Delete: Delete a record that is specified using its record id. We must identify the page in the file into
which the new record must be inserted, fetch that page from the disk, modify and then write it back.

EVALUATION

Define the following basic terms with respect to computer files: Record, File, Data and Field
2. List types of data items.

3. Construct a sample sketch of computer file structure.

4. List 3 types of file organization method.

5. List three methods of accessing files.

6. List 3 methods of in which file can be classified.

7. State four (4) criteria for file classification.

READING ASSIGNMENT
Study the topic ‘Internet’ using your students’ textbook

WEEKEND ASSIGNMENT

1. Records in a ………………………… file are inserted as they arrive


(a) Serial (b) sequential (c) indexed (d) random
2. ……………. is the collection of related data items or field.
(a) Data item (b) Field (c) Record (d) File
3. ………………. is the smallest unit of information stored in computer file
(a) Data item (b) Field (c) Record (d) File
4. ……………………. file is referred to as direct access file
(a) Random (b) Indexed (c) Serial (d) Sequential
5. A file that is sorted on a sequence of fields is called………………
(a) Heap file (b) random file (c) Stack file (d) hash file.

ESSAY QUESTION
1. Clearly distinguish between sequential and random file organization
WEEK 3

THE INTERNET

OBJECTIVES

* Definition of Internet.
* Internet browsers.
* Benefits of Internet.

*Definition of Internet terms

*Internet Services

Definition of Internet
The Internet is a global system of interconnected computer networks that use the Standard Internet
Protocol Suite (TCP/IP) to serve billions of users worldwide. It is a network of networks that consists
of millions of private, public, academic, business and government networks of local to global scope
that are linked by a broad array of electronic and optical networking technologies. Simply put, the
Internet is a collection of computers, all linked together, to share information worldwide. It is the
largest computer network in the world.

The Internet Browser


The Internet browser is also called a web browser. It is a software application (client Application) that
is used to access and view web pages in the internet. Most browsers can be used to send and receive
e-mail, connect to web based e-mail services and read newsgroup. Some popular browsers are:
Internet Explorer, Opera, Safari, Chrome, Mozilla, Netscape navigator.

Benefits of Internet to the society


The Internet plays a major role in the society in the following application areas
1. Education/E-Learning: With the internet, people can get educational materials and read them in
preparation for examinations, or use them for school assignments. The internet also enhances
electronic learning whereby courses or subjects are taught online using audio and or visual materials.
2. E-Registration: The internet provides users with facilities for online registration for examinations
like WAEC, NECO and JAMB.
3. Entertainment: The internet kills boredom and enhances leisure by providing its users with latest
entertainment in the form of movies, games, News and many more.
4. Communication: This is one of the key benefits of the internet. The internet provides many means
by which users can communicate with friends, family, colleagues, and lots more through email, chat
messenger, face books, etc.
5. E-Banking: The internet can be used as a tool to carry out transactions with banks irrespective of
user’s location.
6. E-Commerce: Internet is also a tool for E- Commerce. It can allow users to buy and sell their goods
and services online regardless of their location.
Internet Terms
1. Cyber café: An internet café or cyber café is a place which provides internet access to the public,
usually for a fee.
2. Cyber space: It is the electronic medium of computer networks, in which online communication
take place.
3. Download: To transfer a file from remote computer to a local computer. In other words, it means
to transfer a file from a web server to a web client.
4. Upload: Transfer a file from a local computer to a remote computer. In other words, it means to
transfer a file from a web client to a web server.
5. Email: E-mail is mail that's electronically transmitted by your computer. 
6. File Transfer Protocol (FTP): FTP is the standard method for downloading and uploading files over
the Internet. 
7. Homepage or Home page: This is the first page that appears when you visit any website. It is also
the page of a Web site that provides the introduction or content with links.
8. HTTP: HTTP is an abbreviation for Hypertext Transfer Protocol. It is the set of rules by which Web
pages are transferred across the Internet.
9. URL: URL Stands for "Uniform Resource Locator." A URL is the address of a specific web page or file
on the Internet
10. World Wide Web (WWW): It is a system of interlinked hypertext documents access via the
internet. It is also defined as part of the internet that contains linked text, image sound, and video
documents
11. Website: A Website is a collection of World Wide Web pages or files.
12.Web page: A Web page is a single hypertext file or a page that is part of a Web site
13. Web server: A server is a computer that delivers web content to web browser.
14. Chat: An online text-based communication between internet users.
15. Chat room: A chat room is part of an online service that provides a venue for communities of
user with common interest to communicate in real time.
16. HTML (Hypertext Markup Language). It is the language of the web.
17. ISP (Internet Service Provider): ISP is an organization that provides access to the internet and
web hosting.
18. Intranet: A private internet running inside a LAN
19. Browse: The term to describe a user’s movement across the web 
20. Web Browser (Internet Browser): A software program used to display Webpages. It is also
defined as is a software application for retrieving, presenting, and traversing (moving through)
information resources on the World Wide Web.

Internet Services

Some services provided by internet are as follows:

1. E-mail

2. Discussion group 

3. Video conferencing

4. FTP

5. WWW
6. Chat

7. Downloading files

8. Uploading files

9. Telnet

10. Usenet

11. Instant message

12. Blog

13. E-commence

Protocols

The two general protocols of WWW are:

1. HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files ( text, graphic images sound,
video and other multimedia files) on the world wide web.

2. HTML (Hypertext Markup Language) is a computer language used to build web pages.

Other protocols Include:

a. TCP: Transmission Control Protocol

b. UDP: User Data-gram Protocol

c. SMTP: Simple Mail Transfer Protocol

d. FTP: File Transfer Protocol

e. POP: Post Office Protocol

f. ICMP: Internet Control Protocol

EVALUATION
1. Define the term “Internet”
2. State FIVE benefits of the Internet to the society.

3. List different internet terms and define them.

4. Define Internet services.

GENERAL EVALUATION
(i) List Five Examples of an internet browser
(ii) What is E-Banking?

READING ASSIGNMENT
Study the topic ‘Internet Security’ using your students’ textbook
WEEKEND ASSIGNMENT
1. An internet benefit that helps people to get materials and read them in preparation for examination is
called……….. (a) E-Learning (b) reference files (c) E-resources (d) E-coordination
2. A term used to refer to the process of accessing and viewing web pages on the
Internet is called…………
(a) Browse (b) Opera (c) Internet (d) scroll
3. All are examples of internet browsers except………..
(a) Opera (b) Safari (c) Chrome (d) Emoticon
4. A global system of interconnected computer network that uses the standard
Protocol suite is called_________(a) Internet (b) Selection (c) user net (d) Sequential
5. A browser can also be called…………….
(a)Web browser (b) Organization browser(c) Storage browser (d) Correction
browser
WEEK: 4

THE INTERNET II

OBJECTIVES
*Internet Security

*Cyber Security threats

*Internet security threats

*Internet Security measures

*Abuse of the internet

Internet Security

Internet Security is a branch of computer security specifically related to the internet. Its
objective is to establish rules and measures to use against attack over the internet. The internet
represents an insecure channel for exchanging information leading to a high risk of intrusion or fraud,
such as phishing. Different methods have been used to protect the transfer of data, including
encryption.
Other methods of Internet Security are
I. Use of cryptographic methods and protocols that have been developed for securing
communication over the internet.
II. IPsec Protocol- This provides security and authentication at the IP layer by using cryptography to
protect the content.

What Is a Cyber Security Threat?


A cyber security threat refers to any possible malicious attack that seeks to unlawfully access data,
disrupt digital operations or damage information. Cyber threats can originate from various actors,
including corporate spies, hacktivists, terrorist groups, hostile nation-states, criminal organizations,
lone hackers and disgruntled employees.

In recent years, numerous high-profile cyber-attacks have resulted in sensitive data being exposed.
For example, the 2017 Equifax breach compromised the personal data of roughly 143 million
consumers, including birth dates, addresses and Social Security numbers. In 2018, Marriott
International disclosed that hackers accessed its servers and stole the data of roughly 500 million
customers. In both instances, the cyber security threat was enabled by the organization’s failure to
implement, test and retest technical safeguards, such as encryption, authentication and firewalls.

Cyber attackers can use an individual’s or a company’s sensitive data to steal information or gain
access to their financial accounts, among other potentially damaging actions, which is why cyber
security professionals are essential for keeping private data protected.
Types of Cyber Security Threats

Cyber security professionals should have an in-depth understanding of the following types of cyber
security threats.

1. Malware

Malware is malicious software such as spyware, ransomware, viruses and worms. Malware is
activated when a user clicks on a malicious link or attachment, which leads to installing dangerous
software. Cisco reports that malware, once activated, can:

 Block access to key network components (ransomware)


 Install additional harmful software
 Covertly obtain information by transmitting data from the hard drive (spyware)
 Disrupt individual parts, making the system inoperable
2. Emotet

The Cybersecurity and Infrastructure Security Agency (CISA) describes Emotet as “an advanced,
modular banking Trojan that primarily functions as a downloader or dropper of other banking
Trojans. Emotet continues to be among the most costly and destructive malware.”

3. Denial of Service

A denial of service (DoS) is a type of cyber-attack that floods a computer or network so it can’t
respond to requests. A distributed DoS (DDoS) does the same thing, but the attack originates from a
computer network. Cyber attackers often use a flood attack to disrupt the “handshake” process and
carry out a DoS. Several other techniques may be used, and some cyber attackers use the time that a
network is disabled to launch other attacks. A botnet is a type of DDoS in which millions of systems
can be infected with malware and controlled by a hacker, according to Jeff Melnick of Netwrix, an
information technology security software company. Botnets, sometimes called zombie systems,
target and overwhelm a target’s processing capabilities. Botnets are in different geographic locations
and hard to trace.

4. Man in the Middle

A man-in-the-middle (MITM) attack occurs when hackers insert themselves into a two-party
transaction. After interrupting the traffic, they can filter and steal data, according to Cisco. MITM
attacks often occur when a visitor uses an unsecured public Wi-Fi network. Attackers insert
themselves between the visitor and the network, and then use malware to install software and use
data maliciously.

5. Phishing

Phishing attacks use fake communication, such as an email, to trick the receiver into opening it and
carrying out the instructions inside, such as providing a credit card number. “The goal is to steal
sensitive data like credit card and login information or to install malware on the victim’s machine,”
Cisco reports.

6. SQL Injection

A Structured Query Language (SQL) injection is a type of cyber attack that results from inserting
malicious code into a server that uses SQL. When infected, the server releases information.
Submitting the malicious code can be as simple as entering it into a vulnerable website search box.

7. Password Attacks

With the right password, a cyber attacker has access to a wealth of information. Social engineering is
a type of password attack that Data Insider defines as “a strategy cyber attackers use that relies
heavily on human interaction and often involves tricking people into breaking standard security
practices.” Other types of password attacks include accessing a password database or outright
guessing.

8. The Internet of Things

Individual devices that connect to the internet or other networks offer an access point for hackers.
Cytelligence reports that in 2019, hackers increasingly targeted smart home and internet of things
(IoT) devices, such as smart TVs, voice assistants, connected baby monitors and cellphones. Hackers
who successfully compromise a connected home not only gain access to users’ Wi-Fi credentials, but
may also gain access to their data, such as medical records, bank statements and website login
information.

Internet Security Measures

1. Keep Your Software Up to Date


As we saw from the stats above, ransomware attacks were a major attack vector of 2017 for both
businesses and consumers. One of the most important cyber security tips to mitigate ransomware is
patching outdated software, both operating system, and applications. This helps remove critical
vulnerabilities that hackers use to access your devices. Here are a few quick tips to get you started:
 Turn on automatic system updates for your device
 Make sure your desktop web browser uses automatic security updates
 Keep your web browser plugins like Flash, Java, etc. updated
Check out our blog on patch management best practices.

2. Use Anti-Virus Protection & Firewall


Anti-virus (AV) protection software has been the most prevalent solution to fight malicious attacks.
AV software blocks malware and other malicious viruses from entering your device and
compromising your data. Use anti-virus software from trusted vendors and only run one AV tool on
your device.
Using a firewall is also important when defending your data against malicious attacks. A firewall helps
screen out hackers, viruses, and other malicious activity that occurs over the Internet and determines
what traffic is allowed to enter your device. Windows and Mac OS X comes with their respective
firewalls, aptly named Windows Firewall and Mac Firewall. Your router should also have a firewall
built in to prevent attacks on your network.
3. Use Strong Passwords & Use a Password Management Tool
You’ve probably heard that strong passwords are critical to online security. The truth is passwords
are important in keeping hackers out of your data! According to the National Institute of Standards
and Technology’s (NIST) 2017 new password policy framework, you should consider:
 Dropping the crazy, complex mixture of upper case letters, symbols, and numbers. Instead, opt for
something more user-friendly but with at least eight characters and a maximum length of 64
characters.
 Don’t use the same password twice.
 The password should contain at least one lowercase letter, one uppercase letter, one number, and
four symbols but not the following &%#@_.
 Choose something that is easy to remember and never leave a password hint out in the open or
make it publicly available for hackers to see
 Reset your password when you forget it. But, change it once per year as a general refresh.
 
4. Use Two-Factor or Multi-Factor Authentication
Two-factor or multi-factor authentication is a service that adds additional layers of security to the
standard password method of online identification. Without two-factor authentication, you would
normally enter a username and password. But, with two-factor, you would be prompted to enter one
additional authentication method such as a Personal Identification Code, another password or even
fingerprint. With multi-factor authentication, you would be prompted to enter more than two
additional authentication methods after entering your username and password.
5. Use Your Mobile Devices Securely
According to McAfee Labs, your mobile device is now a target to more than 1.5 million new incidents
of mobile malware. Here are some quick tips for mobile device security:
1. Create a Difficult Mobile Passcode – Not Your Birthdate or Bank PIN
2. Install Apps from Trusted Sources
3. Keep Your Device Updated – Hackers Use Vulnerabilities in Unpatched Older Operating Systems
4. Avoid sending PII or sensitive information over text message or email
5. Leverage Find my iPhone or the Android Device Manager to prevent loss or theft
6. Perform regular mobile backups using iCloud or Enabling Backup & Sync from Android

ABUSES OF THE INTERNET

In spite of its benefits, some people use the internet for negative things. Abuses of the internet include:
1. Fraud: Some people to try to deceive and collect money from them. This is a serious crime.
2. Pornography: Many websites that look innocent have been used to publish pornographic materials several
people have become addicted to watching pornography on the internet.
3. Spam: Spam is e-mail that one has not requested for. Spam is becoming a problem on the internet because
many mailboxes are filled up with a large number of unrequested e-mails daily.
E-mail users have to take time to sort through spam to find the genuine e-mail; this process takes time and
money. Most ISPs provide software that try to separate genuine e-mail from Spam. Such software’s are called
Spam filters.
4. Addiction: some people get addicted to browsing all day. This causes their school and other work to suffer.
5. Hacking: Unauthorized access to another computer which can be successful or unsuccessful.
6. Sniffing: Capturing information that was intended for other machines.
7. Spoofing attack: Creating half open connection structures on the victim’s system making it impossible for
the victim to accept any new incoming connection until the file expires.
8. False e-mail address: Used with the intention of masking identity.
9. Mail bomb: Sending of multiple e-mail messages to an address with the sole intent of overloading the
recipients’ mailbox.
10. TCP SYN Flooding attack: Sending multiple TCP SYN packets to another computer with the intention of
exhausting the targets resources.

EVALUATION:

1. Define Internet Security


2. Mention any four internet security threats.
3. Outline Internet security measures
4. State six(6) ways of internet abuse

1. What is ‘Spam mail’?


2. Define internet insecurity.

READING ASSIGNMENT:
Students are expected to read ‘methods of file security’ of Handbook on Computer studies for SS2.

WEEKEND ASSIGNMENT:
1. A Mail that one has not requested for is called …………
(a) Spam (b) View (c) Delete (d) Creation
2. …………… is not a measure of internet security
(a) Encryption (b) protocols (c) Cryptographic methods (d) Usenet
3. A secret word or string of characters that is used for authentication, to prove identity or gain
access to a resource ——–
(a) Computer file (b) Manual file (c) Password (d) Overwriting
4. A branch of computer security specifically related to the internet is called……
(a) Internet breach (b) Encryption (c) dotted file (d) Anti-spam.
5. ———— is not a way in which the internet can be abused
(a) Mail bomb (b) Hacking (c) Spam mails (d) TCP transponder
WEEK 4

DATA MODEL
SUB-TOPICS: Definition of Data model Types of data model

LEARNING OBJECTIVES At the end of the lesson, I should be able to: i. Explain the term Data Model ii. State the
types of Data Models

DEFINITION

 A model is like a blueprint of a more complex real-world object or event.


 A data model is a picture or description which shows how data is to be arranged to serve a specific
purpose.
 A data model defines how data is connected to each other and how they are processed and stored
inside the system.
 A data model documents and organizes data, how it is stored and accessed, and the relationships
among different parts of data.

TYPES OF DATA MODEL

1. Flat file model: A flat data is a type of database that stores data in a single table. Flat file databases are
generally in plain-text form, where each line holds only one record. The fields in the record are separated
using delimiters such as tabs and commas.

2. Hierarchical model: In this model, data is organized into a tree like structure. The data is stored as records
which are connected to one another through links. In a hierarchical model, each child record has only one
parent, whereas each parent record can have one or more children. At the top of hierarchy there is only one
entity which is called Root. In order to retrieve data from a hierarchical database the whole tree needs to be
traversed starting from the root node.
3. Network model: In the network model, data records are organized in a graph, in which some records can be
accessed through several paths. This model organizes data using two fundamental constructs, called records
and sets. Records contain fields, and sets define one-to-many relationships between records: one owner,
many members.

4. Relational model: In this model, data record is organized in two-dimensional tables called relations. The
tables or relations are related to each other. Each table is made up of rows and columns and a table stores
records about a particular subject. Relational data models are used in IBM’s DB2, Informix, Oracle, Sybase,
Paradox, FoxBASE, Teradata).

5. Entity-relationship model: this model is based on the notion of real world entities and relationships among
them. ER model is based on:

 Entities and their attributes


 Relationships among entities

In ER modeling, the structure for a database is portrayed as a diagram called an entity-relationship diagram (or
ER diagram). An example is shown below:
EVALUATION

1. Define data model.

2. State types of data models.


WEEK 5

DATA MODELLING

SUB-TOPICS: Definition of Data modeling Approaches to data model Data modeling using MS Access

LEARNING OBJECTIVES

At the end of the lesson, I should be able to:

i. Create simple Data Model; ii. Explain the significance of Data Model; iii. Give examples of Standard Data
Model.

DEFINTION

Data modeling is the process of creating a data model for an information system by applying certain formal
techniques

APPROACHES TO DATA MODEL

The three approaches to data model are:

1. Conceptual data model

2. Logical data model

3. Physical data model

Conceptual data model: This is the first stage of database design. A conceptual data model identifies the
highestlevel relationships between different entities. In a conceptual data model, the following steps are
taken:

1. Specify the important entities and the relationships among them

2. No attribute is specified

3. No primary key is specified

Logical data model: This is the second stage in database design. A logical data model describes the data in as
much details as possible, without regard to how they will be physically implemented in the database. In a
logical data model, the following steps are taken:

1. Specify primary keys for all entities

2. Find the relationships among different entities

3. Find all attributes for each entity

4. Resolve many-to-many relationships

5. Normalization
Physical data model: Physical data model is the transformation of the logical database into the actual
database. Physical data model represents how the model will be built in the database. A physical database
model shows all table structures, including column name, column data type, column constraints, primary key,
foreign key and relationships between tables. The steps for physical data model design are as follows:

1. Convert entities into tables

2. Convert relationships into foreign keys

3. Convert attribute into columns

4. Modify the physical data model based on physical constraints/requirements.

CREATING LIBRARY DATABASE

The following table information will be used to create a Library database:

 Author (AuID, AuName, AuPhone, Address,)


 Book (ISBN, title, PubName, Category, AuID, Price)
 Publisher (PubID, PubName, PubPhone, AuID, ISBN)

To create the “library” database, follow the following steps:

 Click on the Start button on the Taskbar


 Point to All Programs
 Select Microsoft Office
 Click Microsoft Access 2010
 Click on Microsoft Office button/File tab
 Click New
 Click the New Blank Database icon
 Type “Library” as the database name in the File Name box
 Click Create. Microsoft Access window will be displayed.

Table

A table is the first and the most important object to be added to a database. It stores data about a particular
subject such as Authors or Books. It consists of records and fields. Each record contains data about one
instance of the table subject, such as a particular author. Each field contains data about one aspect of the
table subject, such as AuthorName, AuthorPhoneNumber, etc. A field is also commonly called a column or an
attribute. A record consists of field values.

Field property

Field property applies to a particular field in a table and defines one of the field’s characteristics or an aspect
of the field’s behavior.

Data types

A field data type indicates the kind of data that field stores or accepts. If the field name holds numeric value,
the data type will be Number. Some of the data types include text, autonumber, number, memo, date/time,
currency, Yes/No, Attachment, etc.
Table relationships

Although each table stores data about a different subject, tables in a database store data about subjects that
are related to each other. Before storing data about different subjects in separate tables, you need a way to
link them together so that you can easily combine related data from those separate tables. To connect the
data stored in different tables, you create relationships. A relationship is a logical connection between two
tables that specify fields that the tables have in common.

Key: A key is a minimal set of attributes whose values uniquely identify an entity in the set. A key consists of
one field, but may consist of more than one field (i.e. Composite key).

Primary key: A primary key consist of one or more fields that uniquely identify each record that you store in
the table. Consider the Student table; the AdmissionNumber field is the primary key of the Student table.

Foreign key: A foreign key contains values that correspond to values in the primary field of another table. It is
a column or combination of columns that is used to establish and enforce a link between the data in two
tables. For example, consider the table information below:

*Author (AuID, AuName, AuPhone, Address,)

* Book (ISBN, title, PubName, Category, AuID, Price)

In the Author’s table information above, AuID field is the primary key but a look at the Book’s table
information, AuID field is also part of its attributes. Here AuID field is a foreign key of the Books table. The
similarity of values between key fields forms the basis of a table relationship.

Forms

A form is another database object that provides a convenient way to enter and view records in a table.

Queries

A query is a database object that enables you to locate records that match specified criteria by providing a way
for you to ask a question about the information stored in a database table.

Report

A report is a database object that allows you to organize, summarize, and print all or a portion of the data in a
database.

SIGNIFICANCE OF DATA MODELS

1. Data models are a great communication tool because it facilitates interaction and communication between
the designers, programmers and end users. 2. A well-developed data model can even foster improved
understanding of the organization for which the database design is developed. 3. Data model help in
structuring and organizing data. 4. Data modeling impose (implicitly or explicitly) constraints or limitations on
the data placed within the structure.

STANDARD DATA MODEL

A standard data model or industry standard data model (ISDM) is a data model that is widely applied in some
industry, and shared amongst competitors to some degrees. They are often defined by standards bodies,
database vendors or operating system vendors. The most effective standard models have developed in the
banking, insurance, pharmaceutical and automotive industries, to reflect the stringent standards applied to
customers information gathering, customer privacy, consumer information gathering, customer privacy,
consumer safety, or just in time manufacturing.

EVALUATION

1. Define Data Modeling

2. Explain the significance of data model.

3. State examples of standard data model.

4. Use MS Access to create table, form, queries and report for all the classes in the school.
WEEK 6

NORMAL FORMS

SUB-TOPICS: • Definition of Normalization • Goals of normalization • Types of normal forms • Problems with
first normal form

LEARNING OBJECTIVES

At the end of the lesson, I should be able to:

i. Explain the term Normal Forms. ii. Give examples of tables in Normal Forms

Normalization

Normalization is the set of guidelines used to optimally design a database to reduce redundant data.
Normalization is a database design technique which organizes tables in a manner that reduces redundancy
and dependency of data.

A database that is not normalized may include data that is contained in one or more different tables for no
apparent reasons. Normalization is achieved by applying a number of tests called normal forms to tables.

Goals of normalization

The goals of normalization are:

1. Eliminating data redundancy i.e. duplication of data

2. To minimize or avoid modification issues

3. To simplify queries

Normal Form

Normal form is the way of measuring the level, or depth, to which a database has been normalized. The most
common normal forms are:

1. First Normal Form (1NF)

2. Second Normal Form (2NF)

3. Third Normal Form (3NF)

Other normal forms are Boyce/Codd Normal Form (BCNF), 4th normal Form and 5th Normal Form.

Note: Each subsequent normal form depends on the normalization steps taken in the previous normal form.
The 3NF is sufficient for most typical database applications.

First Normal Form (1NF)

A database table is said to be in 1NF if:


 It contains no repeating or duplicate fields/columns (i.e. each column name should be unique)
 No data in a columns is multi-valued (i.e. each data field is single value)
 Each row of data has a unique identifier (or Primary Key)
 The attribute domain remains the same (i.e. age value cannot be in the name column)

For example, consider the un-normalized table below:

Item Colour Price Tax


T-shirt Red, Blue 12.00 0.60

Polo Red, Yellow 12.00 0.60

T-shirt Red, Blue 12.00 0.60

Sweatshirt Blue, Black 25.00 1.25

Pant White 6.00 0.30

Table1: Un-normalized table

The table above is not in a first normal form because:

 Multiple items in color field (i.e. red and blue , red and yellow etc)
 Duplicate records/no particular primary key (i.e. row1 and row3)
 So, how do you convert the table above into 1NF?
 Delete one of the duplicate records (i.e. row1 or row3)
 Expand the remaining rows such that each column has a single value

The resulting table now in 1NF is shown below.

Item Colour Price Tax


T-shirt Red 12.00 0.60

T-shirt Blue 12.00 0.60

Polo Red 12.00 0.60

Polo Yellow 12.00 0.60

Sweatshirt Blue 25.00 1.25

Sweatshirt Black 25.00 1.25

Pant White 6.00 0.30


Table 2: 1NF table

Problems with tables in First Normal Form (1NF)

Insert anomalies: An Insert Anomaly occurs when certain attributes cannot be inserted into the database
without the presence of other attributes. Suppose a new item has just been bought and is to be added into the
table and you do not know the tax applicable, it will be difficult to enter a few item of information and not all,
thereby leading to Insertion Anomaly.

Delete anomalies: A Delete Anomaly exists when certain attributes are lost because of the deletion of other
attributes. If the White color of the item Pant is no more in stock, and we try to delete ‘white’ from the color
column, then we will be forced to remove the item Pant, the price and the tax as well since the entire row will
be deleted

Update anomalies: An Update Anomaly exists when one or more instances of duplicated data are updated,
but not all. For example, if the tax applicable to the price 12.0 changed, then we will have to update all the
rows where there is 0.60, else data will become inconsistent i.e. there will be different tax value for the price
12.0 in different rows.

Second Normal Form (2NF)

A database table is in a 2NF if and only if:

1. It is in 1NF and

2. Every non-key attribute is fully functionally dependent on the primary key i.e. there should be no partial
dependency in the table.

Third Normal Form (3NF)

The third normal form's objective is to remove data in a table that is not dependent on the primary key.

A database table is said to be in 3NF if:

 It is in a 2NF
 All non-key field depend only on the primary key – no transitive dependency (i.e. Eliminate all fields
that do not depend on the primary key by moving them into a separate table)

EVALUATION

1. Explain the term Normalization and Normal Form.

2. Give an example of forms or Normal Forms.

3. Give an example of tables in the Normal Forms.


WEEK 7

ENTITY RELATIONSHIP MODEL


CONTENT:
1. Entities, attributes and relationship
2. Additional features of entity model

Sub-topic
Entities, attributes and relationship

PRODUCT Entity
ProductID

Unit
price
Qty on hand Supplie
d by
Cardinality

Attributes

SUPPLIER Name
Relationship
Address

The rectangle in the diagram above is called entity type and the ovals are called attributes. The entities are the
‘things’ in business environment about which we want to store data. The attributes provide us with a means
of organizing and structuring the data.

Entities
Entities are drawn as rectangular boxes containing a noun in singular form.
You will see later that each entity you draw ultimately becomes a table in your database. You might want to
keep this transformation from entity to table in mind when selecting the names of your entities. E.g. your
entity names should be short but descriptive.
Customer

Relationship
A relationship between entities is drawn as a line bisected by a diamond. The diamond contains a verb (or
short verb phrase) that describes the nature of the relationship between the entities.

Named relationship are used to make the ERDs more readable. However, unlike entity names, relationship
names never show up in the final database.

Buys
Attributes
Attributes are properties or characteristics of a particular entity about which we wish to collect and store data.
In addition, there is typically one attribute that uniquely identifies particular instances of the entity. E.g. each
of your customers may have a unique customer ID. Such attributes are known as Key attributes.

Name
Phone No

CustID

Customer
Contact person

Additional features of entity model

Associative entities
Given the number and importance of the attributes attached to the ‘buys’ relationship, it makes sense to treat
the relationship as an entity as an entity in its own right. To transform a relationship into an entity on an ERD,

we use a special symbol called an associative entity. The notation for an associative entity is a relationship
diamond nested inside of an entity rectangle.

Name
Phone No

CustID

Contact person
Product
Sale

EVALUATION:
i. What are entities?
ii. What are attributes?
iii. What are associative entities?

READING ASSIGNMENT:
Study the topic ‘Relational Model” using students’ textbook
WEEKEND ASSIGNMENT:
OBJECTIVE TEST:
1. The ___ provide us with a means of organizing and structuring the data.
2. A set of tools and procedures for applying the tools that specifies the notation used within the
organization is called ______
3. To transform a relationship into an entity on an ERD, we use a special symbol called an (a)
Entity (b) Attribute (c) associative entity (d) none of the above
WEEK 8
RELATIONAL MODEL
CONTENT:
1. Definition of relational model
2. Components of relational model
3. Characteristics of Relational Database
4. Basic terms in relational model

Relational model stores data in the form of tables. This concept purposed by Dr. E.F. Codd, a
researcher of IBM in the year 1960s. The relational model consists of three major components:
1. The set of relations and set of domains that defines the way data can be represented (data
structure).
2. Integrity rules that define the procedure to protect the data (data integrity).
3. The operations that can be performed on data (data manipulation).
A rational model database is defined as a database that allows you to group its data items into one
or more independent tables that can be related to one another by using fields common to each
related table.
Characteristics of Relational Database

Relational database systems have the following characteristics:


• The whole data is conceptually represented as an orderly arrangement of data into rows and
columns, called a relation or table.
.All values are scalar. That is, at any given row/column position in the relation there is one and only
one value.
. All operations are performed on an entire relation and result is an entire relation, a concept known
as closure.
Dr. Codd, when formulating the relational model, chose the term “relation” because it vas
comparatively free of connotations, unlike, for example, the word “table”. It is a common
misconception that the relational model is so called because relationships are established between
tables. In fact, the name is derived from the relations on whom it is based. Notice that the model
requires only that data be conceptually represented as a relation, it does not specify how the data
should be physically implemented. A relation is a relation provided that it is arranged in row and
column format and its values are scalar. Its existence is completely independent of any physical
representation.
Basic Terminology used in Relational Model
The figure shows a relation with the. Formal names of the basic components marked the entire
structure is, as we have said, a relation.
                       

Tuples of a Relation

Each row of data is a tuple. Actually, each row is an n-tuple, but the “n-” is usually dropped.
Cardinality of a relation: The number of tuples in a relation determines its cardinality. In this case,
the relation has a cardinality of 4.
Degree of a relation: Each column in the tuple is called an attribute. The number of attributes in a
relation determines its degree. The relation in figure has a degree of 3.
Domains: A domain definition specifies the kind of data represented by the attribute.
More- particularly, a domain is the set of all possible values that an attribute may validly contain.
Domains are often confused with data types, but this is inaccurate. Data type is a physical concept
while domain is a logical one. “Number” is a data type and “Age” is a domain. To give another
example “StreetName” and “Surname” might both be represented as text fields, but they are
obviously different kinds of text fields; they belong to different domains.
Domain is also a broader concept than data type, in that a domain definition includes a more
specific description of the valid data. For example, the domain Degree A warded, which represents
the degrees awarded by a university. In the database schema, this attribute might be defined as Text
[3], but it’s not just any three-character string, it’s a member of the set {BA, BS, MA, MS, PhD, LLB,
MD}. Of course, not all domains can be defined by simply listing their values. Age, for example,
contains a hundred or so values if we are talking about people, but tens of thousands if we are
talking about museum exhibits. In such instances it’s useful to define the domain in terms of the
rules, which can be used to determine the membership of any specific value in the set of all valid
values.
For example, Person Age could be defined as “an integer in the range 0 to 120” whereas Exhibit Age
(age of any object for exhibition) might simply by “an integer equal to or greater than 0.”
Body of a Relation: The body of the relation consists of an unordered set of zero or more tuples.
There are some important concepts here. First the relation is unordered. Record numbers do not
apply to relations. Second a relation with no tuples still qualifies as a relation. Third, a relation is a
set. The items in a set are, by definition, uniquely identifiable. Therefore, for a table to qualify as a
relation each record must be uniquely identifiable and the table must contain no duplicate records.
Keys of a Relation

It is a set of one or more columns whose combined values are unique among all occurrences in a
given table. A key is the relational means of specifying uniqueness. Some different types of keys are:
Primary key is an attribute or a set of attributes of a relation which posses the properties of
uniqueness and irreducibility (No subset should be unique). For example: Supplier number in S table
is primary key, Part number in P table is primary key and the combination of Supplier number and
Part Number in SP table is a primary key
Foreign key is the attributes of a table, which refers to the primary key of some another table.
Foreign key permit only those values, which appears in the primary key of the table to which it
refers or may be null (Unknown value). For example: SNO in SP table refers the SNO of S table,
which is the primary key of S table, so we can say that SNO in SP table is the foreign key. PNO in SP
table refers the PNO of P table, which is the primary key of P table, so we can say that PNO in SP
table is the foreign key.
Operations in Relational Model

The four basic operations Insert, Update, Delete and Retrieve operations are shown below on the
sample database in relational model:
Insert Operation: Suppose we wish to insert the information of supplier who does not supply any
part, can be inserted in S table without any anomaly e.g. S4 can be inserted in Stable. Similarly, if we
wish to insert information of a new part that is not supplied by any supplier can be inserted into a P
table. If a supplier starts supplying any new part, then this information can be stored in shipment
table SP with the supplier number, part number and supplied quantity. So, we can say that insert
operations can be performed in all the cases without any anomaly.
Update Operation: Suppose supplier S1 has moved from Qadian to Jalandhar. In that case we need
to make changes in the record, so that the supplier table is up-to-date. Since supplier number is the
primary key in the S (supplier) table, so there is only a single entry of S 1, which needs a single
update and problem of data inconsistencies would not arise. Similarly, part and shipment
information can be updated by a single modification in the tables P and SP respectively without the
problem of inconsistency. Update operation in relational model is very simple and without any
anomaly in case of relational model.
Delete Operation: Suppose if supplier S3 stops the supply of part P2, then we have to delete the
shipment connecting part P2 and supplier S3 from shipment table SP. This information can be
deleted from SP table without affecting the details of supplier of S3 in supplier table and part P2
information in part table. Similarly, we can delete the information of parts in P table and their
shipments in SP table and we can delete the information suppliers in S table and their shipments in
SP table
Advantages and Disadvantages of Relational Model
The major advantages of the relational model are:

Structural independence: In relational model, changes in the database structure do not affect the
data access. When it is possible to make change to the database structure without affecting the
DBMS’s capability to access data, we can say that structural independence has been achieved. So,
relational database model has structural independence.
Conceptual simplicity: We have seen that both the hierarchical and the network database model
were conceptually simple. But the relational database model is even simpler at the conceptual level.
Since the relational data model frees the designer from the physical data storage details, the
designers can concentrate on the logical view of the database.
Design, implementation, maintenance and usage ease: The relational database model\ achieves
both data independence and structure independence making the database design, maintenance,
administration and usage much easier than the other models.
Ad hoc query capability: The presence of very powerful, flexible and easy-to-use query capability is
one of the main reasons for the immense popularity of the relational database model. The query
language of the relational database models structured query language or SQL makes ad hoc queries
a reality. SQL is a fourth generation language (4GL). A 4 GL allows the user to specify what must be
done without specifying how it must be done. So, sing SQL the users can specify what information
they want and leave the details of how to get the information to the database.
Disadvantages of Relational Model

The relational model’s disadvantages are very minor as compared to the advantages and their
capabilities far outweigh the shortcomings Also, the drawbacks of the relational database systems
could be avoided if proper corrective measures are taken. The drawbacks are not because of the
shortcomings in the database model, but the way it is being implemented.
Some of the disadvantages are:
Hardware overheads: Relational database system hides the implementation complexities and the
physical data storage details from the users. For doing this, i.e. for making things easier for the
users, the relational database systems need more powerful hardware computers and data storage
devices. So, the RDBMS needs powerful machines to run smoothly. But, as the processing power of
modem computers is increasing at an exponential rate and in today’s scenario, the need for more
processing power is no longer a very big issue.
Ease of design can lead to bad design: The relational database is an easy to design and use. The
users need not know the complex details of physical data storage. They need not know how the
data is actually stored to access it. This ease of design and use can lead to the development and
implementation of very poorly designed database management systems. Since the database is
efficient, these design inefficiencies will not come to light when the database is designed and when
there is only a small amount of data. As the database grows, the poorly designed databases will slow
the system down and will result in performance degradation and data corruption.
‘Information island’ phenomenon: As we have said before, the relational database systems are easy
to implement and use. This will create a situation where too many people or departments will
create their own databases and applications.
These information islands will prevent the information integration that is essential for the smooth
and efficient functioning of the organization. These individual databases will also create problems
like data inconsistency, data duplication, data redundancy and so on.
But as we have said all these issues are minor when compared to the advantages and all these
issues could be avoided if the organization has a properly designed database and has enforced good
database standards.

Week end Project;

Prepare a student database with the following fields, Firstname, Lastname, Class, scores and run queries on
it.

You might also like