31
8/7/2019 Unit I -- Introduction to Database http://slidepdf.com/reader/full/unit-i-introduction-to-database 1/31 1 Kanika Behl Database Management System Introduction

Unit I -- Introduction to Database

Embed Size (px)

Citation preview

Page 1: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 1/31

1

Kanika Behl

Database ManagementSystem

Introduction

Page 2: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 2/31

Objectives

Introduction to Database

Characteristics of Database

Database objectives and advantages Database applications

Introduction to DBMS

Elements of DBMS

Functions of DBMS

Metadata and Data dictionary

Online Shopping application

Page 3: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 3/31

Database Prehistory

Data entry Storage and retrieval  

Query processing Sorting 

Page 4: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 4/31

Early Automation

Data management and application code were all tangled

together 

Hard to modify

Hard to generalize

Many competing approaches

Data manipulation code written at very low levels of 

abstraction

Page 5: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 5/31

Our Hero -- E. F. Codd

Edgar F. "Ted" Codd ( August 23, 1923 - April 18, 2003) was a British

computer scientist who invented relational databases while working for 

IBM.

He was born in Portland, Dorset, studied maths

and chemistry at Oxford. He was a pilot in the

Royal Air Force during WWII. In 1948 he joined IBM

in New York as a mathematical programmer.

His 1970 paper ³A Relational Model of Data for 

Large Shared Data Banks´ changed everything.

In the mid 1990¶s he coined the term OLAP.

Page 6: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 6/31

Database

Shared collection of logically related data (and a descriptionof this data), designed to meet the information needs of anorganization.

Shared collection ± can be used simultaneously by many

departments and users.

Logically related - comprises the important objects and therelationships between these objects.

Description of the data ± the system catalog (meta-data)

 provides description of data to enable data independence

Page 7: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 7/31

What is a database

A database is any organized collection of data. Some examplesof databases you may encounter in your daily life are:

a telephone book 

T.V. Guide

airline reservation system

motor vehicle registration records

files on your computer hard drive.

Page 8: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 8/31

Database Applications

Library catalogues

Medical records

Bank accounts

Stock market data

Personnel systems

Product catalogues

Telephone directories

Train timetables

 Airline bookings

Credit card details

Student records

Customer histories

Stock market prices

Discussion boards

and so on«

Page 9: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 9/31

Why Study Databases?

Databases are useful

Many computing applications deal with large amounts of information

Database systems give a set of tools for storing, searching andmanaging this information

Databases for you

Databases are a µcore topic¶ in computer science and IT

Basic concepts and skills with database systems are part of theskill set you will be assumed to have as a CS and IT graduate

Almost everything we see uses a DBMS ± and especially on theinternet.

Page 10: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 10/31

Why do we need a database?

K eep records of our:

Clients

Staff  Volunteers

To keep a record of activities

and interventions

K eep sales records Develop reports

Perform research

Page 11: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 11/31

Page 12: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 12/31

What is a database system?

 A database is a large, integrated collection of data

 A database contains a model of something!

 A database management system (DBMS) is asoftware system designed to store, manage andfacilitate access to the database

Page 13: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 13/31

Collection of interrelated data Set of programs to access the data

DBMS contains information about a particular enterprise

DBMS provides an environment that is both convenient and efficient to use.

Databases touch all aspects of our lives

Database Applications:

Banking: all transactions

Airlines: reservations, schedules

Universities: registration, grades

Sales: customers, products, purchases

Manufacturing: production, inventory, orders, supply chain

Human resources: employee records, salaries, tax deductions

Database Management System (DBMS)

Page 14: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 14/31

` In the early days, database applications were built on top of filesystems.

` Drawbacks of using file systems to store data:

1. Data redundancy and inconsistency - duplication of 

information in different files. Uncontrolled duplication of data is undesirable for following reasons:

xDuplication costs time and money to enter data more than once.

xIt takes additional storage space thus again increasing associatedcosts. It can be avoided by sharing data files.

x

It may lead to data inconsistency.

Difficulty in accessing data

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

Purpose of Database System

Page 15: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 15/31

3. Data isolation (multiple files and formats)

When data is isolated in separate files, it is more difficult to

access data and to ensure that data is correct.

Also, the structure of file depends on application

 programming language. Thus the direct incompatibility of such files makes it difficult to process jointly.

4. Integrity problems

Integrity constraints (e.g. account balance > 0) become part of program code

Hard to add new constraints or change existing ones.

Drawbacks of file systems (contd.)

Page 16: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 16/31

5. Atomicity of updatesxFailures may leave database in an inconsistent state with partialupdates carried out.

xE.g. transfer of funds from one account to another should either complete or not happen at all.

6. Concurrent access by multiple usersxConcurrent accessed needed for performance.

xUncontrolled concurrent accesses can lead to inconsistencies

xE.g. two people reading a balance and updating it at the same time.

7. Security problems

Database systems offer solutions to all the above problems

Drawbacks of file systems (cont.)

Page 17: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 17/31

Advantages of DBMS

` Control of data redundancy

` Data consistency

` More information from the same amount of data

` Sharing of data

`

Improved data integrity` Improved security

` Enforcement of standards

` Economy of scale

` Balance of conflicting requirements

` Improved data accessibility and responsiveness` Increased productivity

` Improved maintenance through data independence

Page 18: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 18/31

Disadvantages of DBMS

`

Complexity ± provision of the functionality we expect from DBMSmakes it extremely complex.

` Size ± complexity and breadth of functionality makes DBMS extremelylarge piece of software.

` Cost of DBMSs ± it varies significantly depending on the environment& functionality provided.

` Additional hardware costs ± to achieve required performance, it is

necessary to procure large memory.

` Performance ± DBMS is written to be more general, to cater for manyapplications rather than just one.

Page 19: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 19/31

Disadvantages of DBMS (contd..)

` Higher impact of failure ± Centralization of resources increases thevulnerability of the system. Since all users & applications rely onDBMS, the failure of one component can bring operations to a halt.

Page 20: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 20/31

Components of the DBMS

1. Hardware ± DBMS and the applications require hardware to

run. It can range from PC to mainframe or network of computers.

It depends on the organization¶s requirements and the DBMSused.

2. Software ± It comprises of following : DBMS software itself 

Application program

Operating System including network software

3. Data - Most important component from end-user¶s point of view.

It acts as a bridge between the machine components and thehuman component.

The database contains both operational data and the metadata.

Page 21: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 21/31

Components of the DBMS (contd«)

4. Procedures ± It refers to the instructions and rules that governthe design and use of the database.

Users of the system require documented procedures on how touse/run the system.

It may consists of instructions like

Log on to the DBMS

Use a particular DBMS facility or application program.

Start and stop DBMS

Make backup copies of the database

Handle H/W and S/W failures.

Change structure of table to improve performance

5. People ± i.e. USERS (includes database designers, DBAs, application programmers, and end-users.)

Page 22: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 22/31

Database Administrator 

Coordinates all the activities of the database system; thedatabase administrator has a good understanding of theenterprise¶s information resources and needs:

Database administrator¶s duties include:

Schema definitionStorage structure and access method definition

Schema and physical organization modification

Granting user authority to access the database

Specifying integrity constraintsActing as liaison with users

Monitoring performance and responding to changes in requirements

Page 23: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 23/31

Page 24: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 24/31

Overall System Structure

  naïve users application sophisticated database

(tellers, agents, etc) programm ers users administrator 

application

inter  

ac e 

¡ 

 pplication

 program query database

scheme

users

application

 program

ob¢ 

ect code query evaluation

engine

£ 

mbedded¤ ¥ ¦ 

 

 precompiler 

¤ ¥ ¦ 

 

compiler  

¤ ¤ ¦ 

 

interpreter 

transaction

manager 

 bu§ § 

er manager 

query

 processor 

storage

manager 

database-

management

system

 ̈

i le manager 

indices Statistical data

Data files Data dictionary

disk storage

Page 25: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 25/31

Overview of system

Page 26: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 26/31

DBMS

Page 27: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 27/31

Functions of a DBMS

Data Storage, Retrieval, and Update.

A User-Accessible Catalog.

Transaction Support.

Concurrency Control Services.

Recovery Services.

Authorization Services.

Support for Data Communication.

Integrity Services.

Services to Promote Data Independence.

Utility Services.

Page 28: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 28/31

Metadata and Data Dictionary

Classically, ³metadata´ is ³data about data.´ The idea is that metadata

describes another piece of data. So, the metadata is not the data, it¶s

 just a d escription of the dat a.

Metadata is a data that provides information about the tables, views,

constraints, stored procedures, etc stored within the database.

The data dictionary (also termed as system catalog) is a repository of all

the metadata relevant to the objects stored in the database and also of 

information concerning the DBMS itself.

If we take a table as an example, the dictionary will store informationsuch as:

Its name

When it was created and when it was last accessed

The names and data types of its attributes (i.e. structural information)

its owner, who may read and write to it (i.e. security information)

where the data is stored (i.e. physical information)

Page 29: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 29/31

Online Shopping Application

Page 30: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 30/31

30

Page 31: Unit I -- Introduction to Database

8/7/2019 Unit I -- Introduction to Database

http://slidepdf.com/reader/full/unit-i-introduction-to-database 31/31