You are on page 1of 49

Computing Essentials

Chapter 11
Databases
Prof. Dr. Malik Sikander Hayat Khiyal
Faculty of Computer Science,
Preston University, Islamabad Campus,
85, Street 3, Sector H-8/1,
Islamabad, PAKISTAN.
drsikandarhayat@preston.edu.pk

03/02/22 Computing Essential Chapter 11 1


Computing Essentials Contents
Chapter 1. Information Technology, the Internet, and You
Chapter 2. The Internet, the Web, and Electronic Commerce
Chapter 3. Application Software
Chapter 4. System Software
Chapter 5. The System Unit
Chapter 6. Input and Output
Chapter 7. Secondary Storage
Chapter 8. Communications and Networks
Chapter 9. Privacy, Security, and Ethics
Chapter 10. Information Systems
Chapter 11. Databases
Chapter 12. System Analysis and Design
Chapter 13. Programming and Languages

03/02/22 Computing Essential Chapter 11 2


Competencies (Page 1 of 1)
 Distinguish between the physical and
logical views of data.
 Describe how data is organized: characters,
fields, records, tables, and databases.
 Define key fields and how they are used to
integrate data in a database.
 Define and compare batch processing and
real-time processing.

03/02/22 Computing Essential Chapter 11 3


Competencies (Page 1 of 2)
 Describe databases, including the need for
databases and database management
systems (DBMSs).
 Describe the five common database models:
hierarchical, network, relational,
multidimensional, and object-oriented.
 Distinguish among individual, company,
distributed, and commercial databases.
 Describe strategic database uses and
security concerns.
03/02/22 Computing Essential Chapter 11 4
Data
Data can be defined as facts or observations about
people, places, things, and events. More specifically,
focuses on how databases store, organize, and use data.
Initially data was limited to numbers, letters, and
symbols recorded by keyboards. Now, data is much
richer and includes
• Audio captured, interpreted, and saved using microphones
and voice recognition systems.
• Music downloaded from the internet and saved on cell
phones, tablets, and other devices.
• Photographs captured by digital cameras, edited by image
editing software, and shared with others over the internet.
• Video captured by digital video camera, TV tuner cards, and
webcams.
03/02/22 Computing Essential Chapter 11 5
Data
There are two ways, or perspectives, to view
data. These perspectives are the physical
view and the logical view.
 The physical view focuses on the actual format and
locations of the data, discussed in chapter 5.
 The logical view focuses on the meaning, content,
and context of the data. End user and most
computer professionals are concerned with this
view. They are involved with actually using the
data with application programs.

03/02/22 Computing Essential Chapter 11 6


Data Organization
The first step in understanding databases is to learn how data
is organized. In the logical view, data is organized into groups
or categories. Each group is more complex than the one
before. (see figure)

Figure Logical data organization


03/02/22 Computing Essential Chapter 11 7
Data Organization
Data is organized by the following groups:
• Character – the most basic logical element, consisting of
individual numbers, letters, and special characters.
• Field – next level, consisting of a set of related characters, for
example, a person’s last name. A data field represents an attribute
(description or characteristic) of some entity (person, place, thing,
or object).
• Record – a collection of related fields; for example, a payroll
record consisting of fields of data relating to one employee.
• Table – a collection of related records; for example, a payroll table
consisting of all the employee records.
• Database – an integrated collection of related tables; for example,
a personnel database contains all related employee tables.
03/02/22 Computing Essential Chapter 11 8
Key Field
A key filed (primary key) is the field in a
record that uniquely identifies each record.
• Tables can be related (connected) to other
tables by key fields.
• Key fields in different files can be used to
integrate the data in a database.
• Common key fields are employee ID
numbers and driver’s license numbers.

03/02/22 Computing Essential Chapter 11 9


Batch versus Real-Time Processing

Traditionally, data is processed in one of


two ways: batch or real-time processing.
• Batch processing – data is collected over
time and then processed later all at one
time (batched). For example, monthly
credit card bills are typically created by
processing credit card purchases
throughout the past month.

03/02/22 Computing Essential Chapter 11 10


Batch versus Real-Time Processing

Figure Batch processing: Monthly credit card statements


03/02/22 Computing Essential Chapter 11 11
Batch versus Real-Time Processing
• Real-time processing (online processing) –
data is processed at the same time the
transaction occurs; direct access storage
devices make real-time processing possible.
For example, a request for cash using an ATM
machine initiates a verification of funds,
approval or disapproval, disbursement of cash,
and an update of the account balance.

03/02/22 Computing Essential Chapter 11 12


Batch versus Real-Time Processing

Figure Real-time processing: ATM withdrawal


03/02/22 Computing Essential Chapter 11 13
Batch versus Real-Time Processing
To efficiently and effectively use computers,
you need to understand data characters,
fields, records, tables, and databases. You
need to be aware of the different ways in
which a database can be structured and the
different types of databases. Also, you need
to know the most important database uses
and issues.

03/02/22 Computing Essential Chapter 11 14


Databases
A database is a collection of integrated data –
logically related files and records.

Need for Databases


Advantages of databases are sharing data,
improved security, reduced data redundancy, and
higher data integrity. For an organization, there
are many advantages to having databases:
• Sharing: In organizations, information from one
department can be readily shared with others.
Billing could let marketing know which customers
ordered large quantities of merchandise.
03/02/22 Computing Essential Chapter 11 15
Databases
• Security: users are given passwords or access only to the
kind of information they need. Thus, the payroll department
may have access to employees’ pay rates, but other
department would not.
• Less data redundancy: Without a common database,
individual departments have to create and maintain their
own data, and data redundancy results. For example, an
employee’s home address would likely appear in several
files. Redundant data causes inefficient use of storage space
and data maintenance problems.
• Data integrity: When there are multiple source of data, each
source may have variations. A customer’s address may be
listed as “Main Street” in one system and “Main St.” in
another. With discrepancies like these, it is probable that the
customer would be treated as two separate people.
03/02/22 Computing Essential Chapter 11 16
Database Management
A database management system (DBMS) is the
software for creating, modifying, and gaining access
to the database. A DBMS consist of five subsystems:
• DBMS engine provides a bridge between logical view of the
data and physical view of the data. When user request data
(logical perspective), the DBMS engine handles the details of
actually locating the data (physical perspective).
• Data definition subsystem defines the logical structure of a
database using a data dictionary or schema. This dictionary
contains a description of the structure of data in the database.
For a particular item of data, it defines the names used for a
particular field. It defines the type of data for each field (text,
numeric, time, graphic, audio, and video). An example of an
Access data dictionary form is presented in Figure.
03/02/22 Computing Essential Chapter 11 17
Database Management

Figure Access data dictionary form


03/02/22 Computing Essential Chapter 11 18
Database Management
• Data manipulation subsystem provides tools for
maintaining and analyzing data. Maintaining data is known
as data maintenance. It involves adding new data, deleting
old data, and editing existing data. Analysis tools support
viewing all or selected parts of the data, querying the
database, and generating reports. Specific tools include
query-by-example and structured query language (SQL).
• Application generation subsystem provides tools for
creating data entry forms with specialized programming
languages that interface or work with common and widely
used programming languages such as C++ or Visual Basic.
See Figure for a data entry form created by the application
generation subsystem in Access.

03/02/22 Computing Essential Chapter 11 19


Database Management

Figure Access data entry form


03/02/22 Computing Essential Chapter 11 20
Database Management
• Data administration subsystem helps to manage
the overall database, that including maintaining
security, providing disaster recovery support, and
monitoring the overall performance of database
operations. Larger organizations typically employ
highly trained computer specialist, called data
administrators (DBAs), to interact with the data
administration subsystem. Additional duties of
database administrators include determining
processing rights or determining which people
have access to what kinds of data in the database.

03/02/22 Computing Essential Chapter 11 21


DBMS Structure

DBMS programs are designed to work with data


that is logically structured or arranged in a
particular way. This arrangement is known as the
database model. These models define rules and
standards for all the data in the database. Five
principal database models are hierarchical,
network, relational, multidimensional, and object-
oriented.

03/02/22 Computing Essential Chapter 11 22


Hierarchical Database
Hierarchical Database uses nodes to link and structure fields
and records; entries may have one parent node with several
child nodes in a one-to-many relationship. The nodes farther
down the system are subordinate to the ones above, like the
hierarchy of managers in a corporation. An example of a
hierarchical database is a system to organize music files. (See
Figure.) the parent node is the music library for a particular end
user. This parent has four has children, labelled “artist.”
Coldplay, one of the children, has three children of its own.
They are labelled “album.” The Greatest Hits album has three
children, labelled “song.”
The problem with a hierarchical database is that if one parent is
deleted, so are all the subordinate child nodes. Moreover, a
child node cannot be added unless a parent node is added first.
03/02/22 Computing Essential Chapter 11 23
Hierarchical Database

Figure Hierarchical database


03/02/22 Computing Essential Chapter 11 24
Network Database
Network database is like hierarchical except a child
node may have more than one parent in a many-to-many
relationship; additional connections are called pointers.
For example, a university could use this type of
organization to record students taking classes. (See
Figure) If you trace through the logic of this
organization, you can see that each student can have
more than one teacher. Each teacher also can teach more
than one course. Students may take more than a single
course. This demonstrates how the network arrangement
is more flexible and, in many cases, more efficient than
the hierarchical arrangement.
03/02/22 Computing Essential Chapter 11 25
Network Database

Figure Network database


03/02/22 Computing Essential Chapter 11 26
Relational Database
Relational database data is stored in tables (relations); related
tables must have a common data item (key field). A table and
its data are called a relation.
An example of a relational database is shown in Figure. The
Vehicle Owner Table contains license numbers, names, and
addresses for all registered drivers. Within the table, a row is a
record containing information about one driver. Each column is
a field. The fields are License Number, Last Name, First
Name, Street, City, State, and Zip. All related tables must have
a common data item, or shared key field, in both tables,
enabling information stored in one table to be linked with
information stored in another. In this case, the three tables are
related by the License Number field.

03/02/22 Computing Essential Chapter 11 27


Relational Database

Figure Relational database


03/02/22 Computing Essential Chapter 11 28
Relational Database
Police officers who stop a speeding car look up the
diver’s information in the Department of Motor
Vehicles database (Figure) using the driver’s license
number. They also can check for any unpaid violations
in the Outstanding Citations Table. Finally, if the
officers suspect that the car is stolen, they can look up
what vehicles the driver owns in the Vehicle Table.
The most valuable feature of relationa database is their
simplicity. Entries can be easily added, deleted, and
modified. The hierarchical and network database are
more rigid. The relational organization is commone for
personal computer DBMSs such as Access.

03/02/22 Computing Essential Chapter 11 29


Relational Database

Figure The Department of Motor Vehicles may use a relational database.

03/02/22 Computing Essential Chapter 11 30


Multidimensional Database

Multidimensional database extend two-


dimensional relational tables to three or more
dimensions, sometimes called a data cube.
Multidimensional database tend to be more
flexible and intuitive than relational databases.

03/02/22 Computing Essential Chapter 11 31


Multidimensional Database
Multidimensional databases provide several
advantages over relational databases. Two of the
most significant advantages are
• Conceptualization. Multidimensional databases and
data cubes provide users with an intuitive model in
which complex data and relationships can be analyzed
without specialized database programming languages.
• Processing speed. Analyzing and querying a large
multidimensional database can be much faster. For
example, a query requiring just a few second on a
multidimensional database could take minutes or
hours to perform on a relational database.

03/02/22 Computing Essential Chapter 11 32


Object-Oriented Database
Object-oriented databases store data, instructions,
and unstructured data. Data is organized using
classes, objects, attributes, and methods.
• Classes are general definitions.
• Objects are specific instances of a class that can
contain both data and instructions to manipulate
the data.
• Attributes are the data fields an object possesses.
• Methods are instructions for retrieving or
manipulation attributes values.

03/02/22 Computing Essential Chapter 11 33


Object-Oriented Database
For example, a health club might use an object-
oriented employment database. (See Figure) The
database uses a class, Employee, to define employee
objects that are stored in the database. This definition
includes the attributes First name, Last name,
Address, and Wage and the method Pay, Bob, Sarah,
and Omar are objects each with specific attributes
designed by their object type. For example, Bob is an
employee and an accountant. Bob has attributes
common to all employees, such as a name and
address. He also has attributes unique to accountants,
such as his certification as a public accountant.
03/02/22 Computing Essential Chapter 11 34
Object-Oriented Database

Figure Object-oriented database


03/02/22 Computing Essential Chapter 11 35
Object-Oriented Database

Although hierarchical and network


databases are still widely used, relational
and multidimensional databases are the
most popular today. Object-oriented
database are becoming more widely used
and a part of a new category of database
known as NoSQL. For a summary of
DMSB organization, see Figure.

03/02/22 Computing Essential Chapter 11 36


Object-Oriented Database

Figure Summary of DBMS organization

03/02/22 Computing Essential Chapter 11 37


Types of Databases
There are four types of databases:
• Individual (personal computer) database: Used by one
person. It is a collection of integrated files primarily used
by just one person. Typically, the data and the DBMS are
under the direct control of the user. They are stored either
on the user’s hard-disk drive or on a LAN file server.
• Company database: stored on central server and manage
by a database administrator; accessed by multiple people.
• Distributed database: many times the data in a company
is spread out geographically; It is accessed by
communications links.
• Commercial databases (information utilities and data
banks): enormous; for particular subjects.
03/02/22 Computing Essential Chapter 11 38
Types of Databases

Figure Commercial database (LexisNexis)


03/02/22 Computing Essential Chapter 11 39
Types of Databases
Some of the most widely used commercial databases
are
• Pro-Quest Dialog – offers business information, as
well as technical and scientific information.
• Dow Jones Factiva – provides world news and
information on business, investments, and stocks.
• LexisNexis – offers news and information on legal
news, public records, and business issues.

03/02/22 Computing Essential Chapter 11 40


Types of Databases
See Figure for a summary of the four types of
databases.

Figure summary of the four types of databases

03/02/22 Computing Essential Chapter 11 41


Database Uses and Issues
Strategic Uses
Databases help users to keep up to date and
to plan for the future. To support the needs
of managers and other business
professionals, many organizations collect
data from a variety of internal and external
databases. This data is then stored in a
special type of database called a data
warehouse. A technique called data mining
is often used to search these databases to
look for related information and patterns.
03/02/22 Computing Essential Chapter 11 42
Database Uses and Issues
Hundreds of databases are available to help
users with both general and specific
business purposes, including
• Business directories providing addresses,
financial and marketing information,
products, and trade and brand names.
• Demographic data, such as country and city
statistics, current estimates on population
and income, employment statistics, census
data, and so on.
03/02/22 Computing Essential Chapter 11 43
Database Uses and Issues
• Business statistical information, such as financial
information on publicly traded companies, market
potential of certain retail stores, and other business
data and information.
• Text databases providing articles from business
publications, press releases, reviews on companies
and products, and so on.
• Web databases covering a wide range of topics,
including all of those previously mentioned. As
mentioned earlier, web search sites like Google
maintain extensive databases of available Internet
content.
03/02/22 Computing Essential Chapter 11 44
Database Uses and Issues
Security
Databases offer a great opportunity for increased
productivity; however, security is always a concern. Two
important security concerns are illegal use of data and
unauthorized access. Personal and private information
about people stored in databases may be used for the
wrong purposes.
Security may require putting guards in company
computer rooms and checking the identification of
everyone admitted. Some security systems electronically
check fingerprints. (See Figure) Most organizations use
firewalls to protect their internal networks.

03/02/22 Computing Essential Chapter 11 45


Database Uses and Issues

Figure Security: electronic fingerprint scanner


03/02/22 Computing Essential Chapter 11 46
Careers in IT

Database administrators use database


management software to determine the most
efficient ways to organize and access a
company’s data. They are also responsible
for database security and system backup. A
bachelor’s degree in computer science or
information systems and technical
experience are required. Expected salary
range is $57,000 to $109,000.
03/02/22 Computing Essential Chapter 11 47
A Look to the Future
The Future of Crime Databases
Have you ever imagined a world without violent crime?
What would you be willing to do (or give up) if your
government could guarantee that all potential criminals
could be stopped before they commit their crime?
Recently, we are close to making this possible through
large and powerful databases, along with computer
programs that can analyze data and make predictions.
The tricky part is that the databases require a significant
amount of personal information from everyone who
lives in the country. Technology has been making better
crime databases and will continue to evolve to improve
our lives as we look to the future.
03/02/22 Computing Essential Chapter 11 48
A Look to the Future
Supposing a crime-predicting program could be
developed, there will be legal challenges to the
type of data collection required. Individuals will
be asked to weigh their privacy against the
possibility of reducing crime. Inevitably, our
trust of the government will also come into
play. What do you think about this sort of future
database? Would you trust the government with
all this personal and biological information? Do
you believe it is worth giving up privacy for the
sake of having security?
03/02/22 Computing Essential Chapter 11 49

You might also like