Chapter (1) Basic Concepts: Objectives
Chapter (1) Basic Concepts: Objectives
Basic Concepts
Objectives
Introducing the concept of database system
Some examples
Advantages of using DBMS
Implication of the DB approach
When not to use DBMS
Introduction
1
Introduction
• Business (stock,
(stock merchandise distribution and control)
• Engineering (design criteria based on available data, previous
data)
• Medicine (patients’ database, diagnostic cases database)
• Law (clients’ record, finger prints, face recognition, ...)
• Education (students’ record, resource distribution, …)
• Library (books’
(books records, availability, and distribution, resource
sharing)
Introduction
Data are usuallyy the known facts that can be recorded and have
implicit meaning.
2
Introduction
A database has some properties:
• A database represents some aspects of the real world. This may be referred to
as the miniworld or the Universe of Discourse (UoD).
Changes in the miniworld are reflected in the database.
• A database is a logically coherent collection of data with some inherent
meaning.
A random collection of some data cannot correctly be referred to as
a database.
• A database is designed, built, and populated with data for a specific purpose.
The users of the database are a specific group of people and the
database has a specific application to these users.
In summary: A database has some source from which data are derived, some
degree of interaction with events in the real world, and an audience that is
actively interested in the contents of the database.
Now, can you see these properties in a phone book? 5
Introduction
A database can be of any size and of varying complexity.
• Boone’s phone database may have 10,000 phone numbers but this number is
much larger in a large city like Charlotte.
• A card catalog of a library may contain a million records.
•The IRS database is much much larger. Just to give you an idea of how much
disk space it may take to keep 100 million records. IRS keeps about 4 years of
returns. In average each return takes about 1000 bytes. Then the total amount
of disk space would be: 4*100,000,000* 1000 (bytes) = 400 Gb.
That brings the disk space issue up. However, a more important issue is the way
the data is organized in a database that makes the search, retrieval, insert, and
update faster.
Such organization is done through the Database Management System (DBMS).
What is a DBMS?
3
Introduction
A database management system (DBMS) is a collection of
programs that enables users to create and maintain a database.
The DBMS is hence a general-purpose software system that
facilitates the processes of
defining, constructing, and
manipulating databases
for various applications.
4
To define this database, we must specify the structure of the records of
each file by specifying the different types of data elements to be stored
in each record.
An Example: Students’
Students Database
In the student database, what are the records that must be included?
Student’s Name
Student’s Number
Class (freshman, sophomore, …)
Major (Math, CS, …)
Courses
Course Name, Course Number, Credit Hours, …
We must also specify a data type for each data element within a record.
10
5
Database manipulation involves querying and updating.
12
6
Characteristics of the Database Approach
14
7
Insulation between Programs and Data, and Data Abstraction
In traditional file processing, the structure of data files is embedded in the
access programs. Thus, any change to the structure of a file may require
changing all programs that access this file.
DBMS access programs do not require such changes in most cases cases. The
structure of data files is stored in the DBMS catalog separately from the
access programs. This property is called program-data independence.
Example- Internal Storage Format for a Student record shown below
Data Item Name Starting Position in Length in Characters
Record (bytes)
Name 1 30
StudentNumber 31 4
Class 35 4
Major 39 4
15
Example:
p Add x y which is the same as: x+yy
Select CourseName where Department =’CS’
This is known as program-operation independence.
The characteristics that allows program-data independence and
program-operation independence is called Data Abstraction.
16
8
Insulation between Programs and Data, and Data Abstraction – cont.
A DBMS provides users with a conceptual representation of data that
includes many of the details of how the data is stored or how the
operations are implemented.
A data
d t model
d l is
i a type
t off data
d t abstraction
b t ti thatth t is
i usedd to
t provide
id this
thi
conceptual representation.
A data model hides storage and implementation details that are not of
interest to most database users.
Support of Multiple Views of the Data
Every user of a database may have a different view of that database
database.
A view may be a subset of the database or it may contain virtual data
that is derived from the database files but is not explicitly stored.
Examples:
Create the student transcript view
17
Create the course prerequisite view
Figure 1.4 – Two views derived from the example database shown in Figure 1.2.
(a) The student transcript view
(b) The course prerequisite view
18
9
Sharing of Data and Multiuser Transaction Processing
19
10
Database Designers
A database designer is responsible
• to identify the data to be stored in the database, and
• to choose appropriate structures to represent and store this data
• to communicate with all prospective database users in order to
understand their requirements
• to come up with a design that meets all the requirements.
End Users
End users are those people who are accessing the database for:
querying,
updating, and
generating
ti reports.
t
There are several categories of end users.
Casual end users
Naive or parametric end users
Sophisticated end users
Stand-alone users. 21
Quiz (1)
End Users
Use the textbook to complete
Casual end users: Occasionally access the database, but they may need
different info at different time.
22
11
Quiz (2)
Determine the End-user type in the following cases:
1) The department secretary uses a system to find out whether you have
enough hours to be a junior.
2)) You are hired byy a company
p y to develop p a ggraphical
p interface for an existing
g
database system that is designed in MySQL.
3) Your boss is a computer programmer/manager trying to find out more about
the tool you have developed in (2).
4) The traffic officer trying to determine your tickets on a computer.
5) Your parents or friends who are having a DBMS for their properties they
own in MS Access and maintain it themselves.
23
Application programmers
implement these specifications as programs,
test,
debug,
document, and
maintain
Th
These cannedd transactions.
t ti
24
12
Workers behind the Scene
In addition to those who design, use, and administrate a database, others
are associated with the design, development, and operation of the DBMS
software and system environment. These people are not interested in the
database itself. We call them the “workers behind the scene.”
They are:
DBMS system designers and implementers
Tool developers
Operators and maintenance personnel
25
• Controlling Redundancy
• Restricting Unauthorized Access
• Providing Persistent Storage for Program Objects
and Data Structures
• Permitting Inferencing and Actions Using Rules
• Providing Multiple User Interface
• Representing Complex Relationships Among
Data
• Enforcing Integrity Constraints
• Providing Backup and Recovery
26
13
Figure 01.05 The redundant storage of data items. (a) Controlled
redundancy: Including StudentName and CourseNumber in the
GRADE_REPORT file. (b) Uncontrolled redundancy: A GRADE_REPORT
record that is inconsistent with the STUDENT records in Figure 01.02, because
the Name of student number 17 is Smith, not Brown.
27
28
14
Summary
We identified several characteristics that distinguish the database
approach from traditional file-processing applications:
• Existence of a catalog.
• Program
Program-data
data independence and program
program-operation
operation
independence.
• Data abstraction.
• Support of multiple user views.
• Sharing of data among multiple transactions.
We then discussed the main categories of database users, or the "actors on the
scene":
"
• Administrators.
• Designers.
• End users.
• System analysts and application programmers.
29
Th we presented
Then d a li
list off capabilities
bili i that
h should
h ld be
b provided
id d by
b the
h DBMS
software to the DBA, database designers, and users to help them design,
administer, and use a database:
• Controlling redundancy.
• Restricting unauthorized access.
• Providing persistent storage for program objects and data structures.
• Permitting inferencing and actions by using rules.
• Providing
ov d g multiple
u t p e use
user interfaces.
te aces.
• Representing complex relationships among data.
• Enforcing integrity constraints.
• Providing backup and recovery.
30
15
We listed some additional advantages of the database approach
over traditional file-processing systems:
31
32
16