data: ◦ raw facts; building blocks of information ◦ unprocessed information information: ◦...

40
Introduction to Database Management System

Upload: polly-powers

Post on 21-Dec-2015

254 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Introduction to Database Management System

Page 2: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Data vs. Information

Data:◦ Raw facts; building blocks of information◦ Unprocessed information

Information:◦ Data processed to reveal meaning

Accurate, relevant, and timely information is key to good decision making

Good decision making is key to survival in global environment

Page 3: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Database Examples Database:

A collection of related data. Database is involved like everywhere in

our world For example:If we go to bank to deposit or withdraw Make hotel and airline reservationPurchase something on lineBuy groceries in supermarkets

Page 4: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Database System Database Management System

(DBMS):A software package/system to facilitate theDefine, Construct, Manipulate and Share

functions of a computerized database.

Page 5: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Database System

What is database system

Database system is a computerized record-keeping system. It is a computerize system whose overall purpose is to store information and to allow users to retrieve and update that information on demand. ◦ Information is anything

that is significant to the individual or organization concerned.

Page 6: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Slide 1- 6

Database Systems: Then

Page 7: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Adding new file to database Inserting data into existing files Retrieving data from existing files Deleting data from existing files Changing data in existing files Removing existing files from the database

Operations

Page 8: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Database System are available on machines that range from all the way from personal computers to the largest mainframe

Single User system is a system in which at most one user can access the database at any given time.

Multi user system is a system in which many users can access the database at the same time.

Data base system

Page 9: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

DataHardwareSoftwareUsers

Database System Components

Page 10: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

The data in database – for large system- will be both integrated and shared.

Integrated◦ Mean the database can be thought of as a

unification of several distinct files, with any redundancy among those files partly or wholly eliminated

Shared◦ Mean the database can be shared among

different users, in the sense that different users can have access to the same data.

Page 11: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

The hardware components of the system consist of

The secondary storage volumes used to hold the stored data, together with the associated I/O devices, device controllers, and so forth.

The hardware processors and associated main memory that are used to supported the execution of the database system software

Hardware

Page 12: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Database Management System (DBMS)Data => physically stored All request for access to the database are

handle by the DBMSDBMS is thus shielding of database users

from hardware level detailsProvides users with a perception of the

database that is elevated somewhat above the hardware level details.

Support user operations

Software

Page 13: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

DATABASE SYSTEM

Application Program/Queries

DBMS SOFTWARE

Software to Process Queries/Programs

Software to Access Stored Data

Stored Database Definition

Stored Database

Users/Programmers

Page 14: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

DATABASE SYSTEM

Application Program/Queries

DBMS SOFTWARE

Software to Process Queries/Programs

Software to Access Stored Data

Stored Database Definition

Stored Database

Users/Programmers

1. Data

2. Software

3. Users

4. Hardware

Page 15: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

DBMS is a general purpose software system that facilitates the process of definition, construction, manipulating, and sharing databases among various users and applications.◦ Defining a database involves specifying the

data types, structures, and constrains for the data to be stored in the database.

Database Management System

Page 16: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Manipulating a database includes such functions as querying the database to retrieve specific data, updating the database to reflect changes, and generating reports from data.

Sharing a database allows multiple users and programs to access the database concurrently.

Other important functions ◦Protection both system protection against

hardware or software malfunction (crash) and Security protection against unauthorized or malicious access.

◦DBMS must be able to maintain the database System by allowing the system to evolve as requirements change over time.

Page 17: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Application Programmer◦ Responsible for writing database application

programs in some programming language

End User◦ Access database interactively as just

described, A given user can access the database via online application program or user query language

User

Page 18: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Database Designers◦ Responsible for identifying the data to be

stored in the database and for choosing appropriate structures to represent and store in database.

◦ It is responsibility of database designers to communicate with all database user to understand their requirements, and to come up with a design that meets users’ requirements.

◦ Designer may be one of staff of Database Administrator (DBA)

Page 19: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Database Administrators: responsible for authorizing access to the database, for coordinating and monitoring its use, and for acquiring software and hardware resource need

Defining the conceptual schema (Logical/conceptual Database Design)

Defining the internal schema (Physical Database design)

Defining security and integrity constraints

Monitoring performance and responding to changing requirement.

Page 20: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Users/Programmers

Application Programs/Queries

Software to Process Quires/Programs

Software to Access Stored

Data

DBMS Software

Stored Database

Stored Database Definition

(Meta Data)

DATABASE SYSTEM

Page 21: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

ARCHITECTUREARCHITECTURE

Page 22: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Database architecture

Page 23: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

The three levels

The external level is the one closest to the users. It Interacts directly with the user. It is the one concerned with the way the data is seen

by individual users( external schema)It Change the data coming from the conceptual level to a format and view that are familiar to the users.

The ANSI architecture is divided into three levels— internal, conceptual, and external

Page 24: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

The conceptual level defines the logical view of the data.

The main functions of DBMS are in this level. It defines what data are to be stored and mentions the relationship that exist between the data

The internal level is the one closest to physical storage.

It is the one concerned with the way the data is stored inside the system.(internal schema). It determines where and how the data are actually stored on the storage device. It deals with the Low-level access method

Page 25: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

The three levels

External level

(individual user views)

Conceptual level

(community user views)

Internal level

(storage views)

The three levels of the architecture

Internal Schema

Conceptual Schema

External schema

External schema

External schema

Page 26: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

The three levels

Detailed system architecture

Page 27: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Three Level Architecture of DBMS

continue…

View 1Item_NamePrice

Conceptual Item_Number Character (6)Item_Name Character(30)Price Numeric(5,2)Stock Numeric(4)

PhysicalStored_Item Length=50Item # Type = Byte(6), offset = 0, Index = IxName Type = Byte(30), offset = 6Price Type = Byte(8), offset = 36Stock Type = Byte(4), offset = 44

ExternalLevel

Conceptual Level

PhysicalLevel

View 2Item_NameStock

Sales Officer Inventory Controller

Page 28: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

This level is closest to the users and is concerned

with the way in which the data is viewed by

individual users. Most of the users are not

concerned with all the information contained in the

database. Instead they need only a part of the

database relevant to them. The system provides

many views for the same database.

External or View Level

Page 29: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

It is the highest level of abstraction of database.

It allows to see only the data of interest to the users.

Users can be – Application programmers or end-users.

Any no. of external views can be viewed from the – external schema.

External or View Levelcontinue…

Page 30: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

30

It contains the methods for deriving the

objects such as entities, attributes and

relationships in the external view from the

Conceptual View.

External or View levelcontinue…

Page 31: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

This level of abstraction describes what data are actually

stored in the database. It also describes the relationships

existing among data. At this level, the database is described

logically in terms of simple data-structures. The users of this

level are not concerned with how these logical data

structures will be implemented at the physical level, rather

they just are concerned about what information is to be kept

in the database.

Conceptual Level

Page 32: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

It is the sum total of DBMS users view.

It describes what data are actually stored in

the database (ie,all the records and

relationships included in the database).

Conceptual Levelcontinue…

Page 33: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

The conceptual view is a representation of

the entire information content of the

database in a form that is some what

abstract in comparison with the way in which

the data is physically stored.

Conceptual Levelcontinue…

Page 34: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

The conceptual view is defined by means of

the conceptual schema, which includes the

definition of each of the various types of

conceptual records and the mapping

between the conceptual schema and the

internal schema.

Conceptual Levelcontinue…

Page 35: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

It is the lowest level of abstraction.

It describes how the data are physically

stored.

Internal view is represented by internal

schema (internal schema defines the

various types of stored record ,specifies

what indexes exists, how files are

represented, etc.)

Internal or Physical Level

Page 36: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

The internal level is closest to physical

storage. This level is also termed as physical

level. It describes how the data are actually

stored on the storage medium. At this level,

complex low-level data structures are

described in detail.

Internal or Physical Level

Page 37: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Mappings

conceptual/internal mapping and several external/conceptual mappings:

1.the conceptual/internal mapping defines the correspondence between the conceptual view and the stored database; it specifies how conceptual records and fields are represented at the internal level.

2.an external/conceptual mapping defines the correspondence between a particular external view and the conceptual view.

Page 38: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

1.5.2 Mappings

Internal Schema

Conceptual Schema

External schema

External schema

External schema

conceptual/internal mapping

external/conceptual

Page 39: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Mappings

Data independence:

1.physical data independence is the ability to modify the physical schema without causing application programs to be rewritten. (conceptual/internal mapping)

2.logical data independence is the ability to modify the logical schema without causing application programs to be rewritten. (external/conceptual)

Page 40: Data: ◦ Raw facts; building blocks of information ◦ Unprocessed information  Information: ◦ Data processed to reveal meaning  Accurate, relevant,

Instances and schemas

The overall design of the database is called the database schema.

The collection of information stored in the database at a particular moment is called an instance of the database.

database schema instance of the database

sn name sex

01 carol female

03 bob malestudent

Student={sn,name,sex}