Anda di halaman 1dari 31

Chapter 1

Introduction to Databases

Chapter 1 - Objectives
y Some common uses of database systems. y Characteristics of file-based systems. y Problems with file-based approach. y Meaning of the term database. y Meaning of the term Database Management

System (DBMS).

Chapter 1 - Objectives
y Typical functions of a DBMS. y Major components of the DBMS environment. y Personnel involved in the DBMS environment. y History of the development of DBMSs. y Advantages and disadvantages of DBMSs.

Examples of Database Applications

y Purchases from the supermarket y Purchases using your credit card y Booking a holiday at the travel agents y Using the local library y Taking out insurance y Renting a video y Using the Internet y Studying at university

File-Based Systems
y Collection of application programs that perform

services for the end users (e.g. reports).

y Each program defines and manages its own data.

File-Based Processing

Limitations of File-Based Approach

y Separation and isolation of data y Each program maintains its own set of data. y Users of one program may be unaware of

potentially useful data held by other programs.

y Duplication of data y Same data is held by different programs. y Wasted space and potentially different values

and/or different formats for the same item.

Limitations of File-Based Approach

y Data dependence
y File structure is defined in the program code.

y Incompatible file formats

y Programs are written in different languages, and so

cannot easily access each others files.

y Fixed Queries/Proliferation of application

y Programs are written to satisfy particular functions. y Any new requirement needs a new program.

Database Approach
y Arose because:
y Definition of data was embedded in application

programs, rather than being stored separately and independently. y No control over access and manipulation of data beyond that imposed by application programs.
y Result:
y the database and Database Management System


y Shared collection of logically related data (and a

description of this data), designed to meet the information needs of an organization.

y System catalog (metadata) provides description of

data to enable programdata independence.

y Logically related data comprises entities,

attributes, and relationships of an organizations information.

But what is data? And where is it now?

Data is factual information about objects and concepts, such as:
measurements statistics

You can find it in:

y filing cabinets y spreadsheets y folders y lists y colleagues memories y piles of papers on your desk

What does managing information mean?

y Making information work for us y Making information useful y Avoiding "accidental disorganisation y Making information easily accessible and

integrated with the rest of our work

Database Management System (DBMS)

y A software system that enables users to define,

create, maintain, and control access to the database.

y (Database) application program: a computer

program that interacts with database by issuing an appropriate request (SQL statement) to the DBMS.

Database Management System (DBMS)

Database Approach
y Data definition language (DDL).
y Permits specification of data types, structures and

any data constraints. y All specifications are stored in the database.

y Data manipulation language (DML).
y General enquiry facility (query language) of the data.

Database Approach
y Controlled access to database may

y a security system y an integrity system y a concurrency control system y a recovery control system y a user-accessible catalog.

y Allows each user to have his or her own view of the

y A view is essentially some subset of the database.

Views - Benefits
y Reduce complexity y Provide a level of security y Provide a mechanism to customize the appearance

of the database y Present a consistent, unchanging picture of the structure of the database, even if the underlying database is changed

Components of DBMS Environment

Components of DBMS Environment


Design tools
Table Creation Form Creation Query Creation Report Creation Procedural language compiler (4GL) ============= Run time
Form processor Query processor Report Writer Language Run time


Application Programs

Database contains: Users Data Metadata Indexes Application Metadata

User Interface Applications

Components of DBMS Environment

y Hardware y Can range from a PC to a network of computers. y Software y DBMS, operating system, network software (if

necessary) and also the application programs. y Data

y Used by the organization and a description of this

data called the schema.

Components of DBMS Environment

y Procedures y Instructions and rules that should be applied to

the design and use of the database and DBMS. y People y Includes database designers, DBAs, application programmers, and end-users.

Roles in the Database Environment

y Data Administrator (DA)
y Database planning y Development and maintenance of standards, policies and procedures

y Database Administrator (DBA)

y y y y

Physical realization of database Physical DB design and implementation Security and integrity control Maintenance of operational system

y Database Designers (Logical and Physical)

y Identifying the data, relationship between data and constrain on data y Mapping the logical DB design into tables and constraints

y Application Programmers y End Users (naive and sophisticated)

History of Database Systems

y First-generation
y Hierarchical Model (1960s and 1970s) y Similar to data structures in programming languages.

Books (id, title) Authors (first, last)



History of Database Systems

y Network Model (1970s)
y Provides for single entries of data and navigational links through chains of


Authors Subjects Books Publishers

structure y No Many-to-Many relationships y Programmers must be thoroughly familiar with the database structure.
y Changes in data structure require changes in application programs that access that

History of Database Systems

y Second generation
y Relational Model (1980s) y Provides a conceptually simple model for data as relations (typically considered tables) with all data visible.
pubid 1 2 3 4 pubname Harper Addison Oxford Que Authorid 1 2 3 4 5 Author name Smith Wynar Jones Duncan Applegate

Book ID 1 2 3 4 5

Title pubid Introductio The history New stuff ab Another title And yet mor

2 4 3 2 1

Author id 1 2 3 4 5

Book ID 1 2 3 4 4

Subid 2 1 3 2 3


Subject 1 cataloging 2 history 3 stuff

Advantage: Many-to-Many relationships are implemented Problems: Navigation is even harder

History of Database Systems

y Third generation
y Object-Oriented y Encapsulates data and operations as Objects

Books (id, title) Authors (first, last) Publisher Subjects

History of Database Systems

y Object-Relational (1990s)
y Combines the well-known properties of the Relational

Model with such OO features as:

y User-defined datatypes y User-defined functions y Inheritance and sub-classing

Advantages of DBMSs
y Control of data redundancy y Data consistency y More information from the same amount of data y Sharing of data y Improved data integrity y Improved security y Enforcement of standards y Economy of scale

Advantages of DBMSs
y Balance conflicting requirements y Improved data accessibility and responsiveness y Increased productivity y Improved maintenance through data independence y Increased concurrency y Improved backup and recovery services

Disadvantages of DBMSs
y Complexity y Size y Cost of DBMS y Additional hardware costs y Cost of conversion y Performance y Higher impact of a failure