Upload
khalil-khussairi
View
216
Download
0
Embed Size (px)
Citation preview
7/29/2019 01 - Introduction to Database
1/17
9/9/2013
1
INTRODUCTION TO
DATABASE
Semester 1 2013/2014
At the end of this module, students should be able to define and
identif the followin s:
Learning Objective Some common uses of database systems (db).
Characteristics, problems and differences between file-based
approach and db approach.
Meaning of terms - db, Database Management System
(DBMS), db application system, db system
Personnel involved in the DBMS environment.
Advantages and disadvantages of DBMSs
Three-Level ANSI-SPARC Architecture
7/29/2019 01 - Introduction to Database
2/17
9/9/2013
2
Introduction The database is now such an integral part of our day-
to-da life that often we are not aware we are usinone
We will examine some applications of databasesystem
We will use some terminology in this chapter : database : a collection of related data
DBMS (database management system) : the software that
manages & controls access to the database database application : a program that interacts with the
database at some point in its execution
database system : a collection of application programs thatinteract with the database along with the DBMS anddatabase itself
3
DB SYSTEM
Overview of DB System
. . . .
. . . .
. . . .
4
DB
APPLICATIONS
DBMSDB
. . . .
USER
7/29/2019 01 - Introduction to Database
3/17
9/9/2013
3
Traditional File Based System An early attempt to computerize the manual filing
Definition
Collection of application programs that performservices for the end users (e.g. reports). Each
program defines and manages its own data.
Works well while the number of items to be stored is
small. However, it breaks down when we have tocross-reference or process the information in the files.
5
File Based Processing
6
7/29/2019 01 - Introduction to Database
4/17
9/9/2013
4
File Based Processing
Figure shows each department accessing their own
for them.
Each set of departmental application programs
handles data entry, file maintenance, and the
generation of a fixed set of specific reports.
records are defined in the application code
7
Limitations of File-Based Approach
Se aration and isolation of data Each program maintains its own set of data.
Users of one program may be unaware of potentially
useful data held by other programs.
8
Same data is held by different programs.
Wasted space and potentially different values and/or
different formats for the same item.
7/29/2019 01 - Introduction to Database
5/17
9/9/2013
5
Data dependence
Limitations of File-Based Approach
.
Changes to an existing structure are difficult to make
Incompatible file formats Programs are written in different languages, and so cannot easily
access each others files.
9
programs
Programs are written to satisfy particular functions.
Any new requirement needs a new program.
Database Approach
The limitations of the file-based approach can
1. Definition of data was embedded in application
programs, rather than being stored separately andindependently.
2. No control over access and manipulation of data
10
beyond that imposed by application programs.
Result, a new approach was required:-
the database and Database Management System
(DBMS).
7/29/2019 01 - Introduction to Database
6/17
9/9/2013
6
The Database Definition :
Shared collection of logically related data (and a descriptiono s a a , es gne o mee e n orma on nee s o anorganization.
A database is also defined as a self-describingcollection of integrated records The description of the data is known as the system
catalogue (metadata) to enableprogramdata independence.
The definition of data is separated from the application
11
program. The users of an object only see the external definition and
unaware of how the object is defined and how it functioned
Logically related data comprises entities, attributes,andrelationships of an organizations information.
DBMS is the software that interacts with the users
Database Management System
(DBMS)
Definition - A software system that enables users todefine, create, and maintain the database and that
provides controlled access to this database.1. Define using Data Definition Language (DDL)
2. Create insert, update, delete & retrieve data using DataMani ulation Lan ua e DML
12
3. Controlled accessed security, integrity, concurrencycontrol, recovery & user-accessible catalog
Example of DBMS Microsoft Access, MicrosoftSQL Server, Oracle, Sybase and etc.
7/29/2019 01 - Introduction to Database
7/17
9/9/2013
7
Data definition language (DDL).
Database Management System
(DBMS)
Permits specification of data types, structures and any data
constraints.
All specifications are stored in the database.
Data manipulation language (DML).
13
General enquiry facility (query language) of the data.
Using Structured Query Language (SQL) to produce required
information.-
Database Application Programs
A computer program that interacts with the database
by issuing an appropriate request (typically an SQL
statement) to the DBMS Users interact with the database through a
number of application programs (used to create &
14
information) written in some programminglanguage
7/29/2019 01 - Introduction to Database
8/17
9/9/2013
8
Database Application Programs Figure shows each department using their
through the DBMS. Each set of departmental application programs
handles data entry, file maintenance, and thegeneration of a fixed set of specific reports.
The physical structure & storage of the data are now
15
A view mechanism. Provides users with only the data they want or
need to use.
DATABASE SYSTEMApplication Program
Database Application Programs
16
7/29/2019 01 - Introduction to Database
9/17
9/9/2013
9
Components of DBMS
Environment
17
Roles in the Database Environment
responsible for the management of the data
resourceDatabase planning
Development and maintenance of standards,
18
po c es, proce ures
Conceptual/logical database design
7/29/2019 01 - Introduction to Database
10/17
9/9/2013
10
Database Administrator (DBA)
Roles in the Database Environment
responsible for the physical realization of thedatabase
Physical database design andimplementation
Maintenance of operational control
Ensuring satisfactory performance ofapplications for users
19
Database Designers (Logical and
Roles in the Database Environment
Physical)
Logical : is concerned with identifying the
data, the relationships between the data, &
the constraint on the data that is to be stored
Physical : decides how the logical database
design is to be physically realized
20
7/29/2019 01 - Introduction to Database
11/17
9/9/2013
11
Roles in the Database Environment
pp ca on rogrammers
build the application programs that provide
the required functionality for the end-users
End Users
naive and sophisticated
21
File-based ApproachLimitation of File Based Approach :
Separation and isolation of data
Duplication of data
Data dependence
Incompatible file formats
Fixed Queries/Proliferation of
application programs
Database ApproachAdv antag es of Dat abase Appro ach : Control of data redundancy
Data consistency
More information from the same amount
of data
22
Sharing of data
Improved data integrity & s ecurity
Improved data accessibility and
responsiveness
Increased productivit y
Improved maintenance through data
independence
Increased conc urrency
Improved backup and recovery services
7/29/2019 01 - Introduction to Database
12/17
9/9/2013
12
Three-Level Architecture
All DBMS are built based on the 3-Level
Architecture
All users should be able to access same
data.
A users view is immune to chan es made
in other views.
Users should not need to know physical
database storage details. 23
DBA should be able to change database
Three-Level Architecture
s orage s ruc ures w ou a ec ng eusers views.
Internal structure of database should beunaffected by changes to physical aspects
.
DBA should be able to change conceptualstructure of database without affecting allusers.
24
7/29/2019 01 - Introduction to Database
13/17
9/9/2013
13
ANSI-SPARC Three-Level Architecture
25
External Level
ANSI-SPARC Three-Level Architecture
Users views of the database.
Describes that part of database that isrelevant to a particular user.
Conceptual Level
Community view of the database.
Describes what data is stored in database
and relationships among the data.26
7/29/2019 01 - Introduction to Database
14/17
9/9/2013
14
Internal Level
ANSI-SPARC Three-Level Architecture
Physical representation of the database
on the computer.
Describes how the data is stored in the
database.
27
Physical Level
ANSI-SPARC Three-Level Architecture
Managed by OS under directions of DBMS
Access methods varies - may follow fully OS
access methods or its own file organizations
with some basic OS access methods
mp ementat on o sequenc ng
How fields of internal records are stored on disks
28
7/29/2019 01 - Introduction to Database
15/17
9/9/2013
15
ANSI-SPARC Three-Level Architecture
29Pearson Education 2009
Data Independence
Referring to mapping between external,
Logical Data Independence
Refers to immunity of external schemas tochanges in conceptual schema.
. .
removal of entities).
Should not require changes to external schema or
rewrites of application programs.30
7/29/2019 01 - Introduction to Database
16/17
9/9/2013
16
Data Independence
Ph sical Data Inde endence
Refers to immunity of conceptual schema to
changes in the internal schema.
Internal schema changes (e.g. using different
file organizations, storage structures/
devices).
Should not require change to conceptual or
external schemas.31
Data Independence and the ANSI-SPARC
Three-Level Architecture
32
7/29/2019 01 - Introduction to Database
17/17
9/9/2013
Summary
Importance of databases
Database approach VS file-based approach
Important terms in database fields
Database, database applications, databasesystems, DBMS
-levels and associations with data
independence
33