Вы находитесь на странице: 1из 20


Prepared & Compiled by P. Praveen Kumar

Examples of Database Applications

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

Data versus Information

Data constitute building blocks of information Information produced by processing data Information reveals meaning of data Good, timely, relevant information key to decision making Good decision making key to survival

File-Based Processing

Drawbacks of using File Systems

Data redundancy and inconsistency
duplication of information in different files Data may updated in one file may not in another file.

Data isolation
Data in multiple files and formats

Difficulty in accessing data

Need to write a new program to carry out each new task

Integrity problems
Integrity constraints (e.g. account balance > 0) become part of program code Hard to add new constraints or change existing ones

Atomicity of updates
Failures may leave database in an inconsistent state with partial updates carried out E.g. transfer of funds from one account to another should either complete or not happen at all

Concurrent access by multiple users

Concurrent accessed needed for performance Uncontrolled concurrent accesses can lead to inconsistencies
E.g. two people reading a balance and updating it at the same time

Security problems
View can not restricted to a particular user

A Database Management System (DBMS) is a software system designed to store, manage, and facilitate access to databases

Database Management System

Database vs. File Systems

Database System Environment

Simplified Database System Environment

Levels of Abstraction or Three Layer Architecture

View 1

View 2

View 3

Conceptual Schema Physical Schema


Data Independence
Applications insulated from how data is structured and stored. Logical data independence: Protection from changes in logical structure of data. Physical data independence: Protection from changes in physical structure of data.

View 1

View 2

View 3

Conceptual Schema Physical Schema


Data Model
A set of concepts to describe the structure of a database. Data Model Operations are used for specifying database retrievals and updates by referring to the constructs of the data model.

Hierarchical Model
Courses Course#* 1 n Prereq PCourse#* Title n Student SSN#* Name GPA

Title 1

n Formats Section#* Campus 1 1


1 Faculty SSFaN#*



Network Model
Courses Course#*




Prereq PCourse#*


Formats Section#*

Quarter Campus


Student SSN#* Name


Faculty SSN#* Name


Relational Model

A key is one or more columns of a relation that identifies a row Composite key is a key that contains two or more attributes A relation has one unique primary key and may also have additional unique keys called candidate keys