Professional Documents
Culture Documents
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
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:
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.
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
2. This file contains data only for period of time and send to the master file
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
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.
READING ASSIGNMENT
Study the topic ‘Internet’ using your students’ textbook
WEEKEND ASSIGNMENT
ESSAY QUESTION
1. Clearly distinguish between sequential and random file organization
WEEK 3
THE INTERNET
OBJECTIVES
* Definition of Internet.
* Internet browsers.
* Benefits of Internet.
*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.
Internet Services
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
12. Blog
13. E-commence
Protocols
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.
EVALUATION
1. Define the term “Internet”
2. State FIVE benefits of the Internet to the society.
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
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.
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:
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.
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.
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.
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:
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
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:
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
DATA MODELLING
SUB-TOPICS: Definition of Data modeling Approaches to data model Data modeling using MS Access
LEARNING OBJECTIVES
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
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:
2. No attribute 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:
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:
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:
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.
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.
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
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
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
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:
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.
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
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.
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.
The third normal form's objective is to remove data in a table that is not dependent on the primary key.
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
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
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
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.
Prepare a student database with the following fields, Firstname, Lastname, Class, scores and run queries on
it.