lecture1: principles of databases - · pdf filechapter1 - objectives • problems with...

39
LECTURE1: PRINCIPLES OF DATABASES Ref. Chapter1 Information Systems Department

Upload: vanque

Post on 30-Jan-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

LECTURE1: PRINCIPLES OF DATABASES

Ref. Chapter1

Information Systems

Department

Page 2: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Chapter1 - Objectives

• Problems with file-based approach.

• Database concepts.

• Database Management System (DBMS).

• Major components of the DBMS environment.

• Users involved in the DBMS environment.

• Advantages and disadvantages of DBMS.

Information Systems Department

2

Page 3: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Introduction

Information Systems Department

3

Examples of Database Applications

Page 4: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

File-Based Systems

• Collection of application programs that perform

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

• Each program defines and manages its own data.

Information Systems Department

4

Page 5: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

File-Based Systems

Information Systems Department

5

Page 6: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Limitations of File-Based Approach

1. Separation 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.

2. Duplication of data

• Same data is held by different programs.

• Wasted space and potentially different values and/or different formats for the same item.

Information Systems Department

6

Page 7: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Limitations of File-Based Approach

3. Data dependence

• File structure is defined in the program code.

• Definition of data was embedded in application programs, rather than being stored separately and independently.

4. Incompatible file formats

• Programs are written in different languages, and so cannot easily access each other’s files.

Pearson Education © 2009 Information Systems Department

7

Page 8: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Solution …

DATABASE APPROACH

Information Systems Department

8

Page 9: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Database Approach

Main terms:

Data

Information

Database

Metadata /System Catalog / data Dictionary

Entity

Attribute

Relationship

Database Management System

Database Application Program

Information Systems Department

9

Page 10: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Database Approach

Data: Known facts that can be recorded and have an implicit

meaning. Ex: What does 3421 means?

Notice there are different types of data

numbers, strings, date, time

Text, picture, audio, video, graphics …

Information Systems Department

10

Page 11: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Database Approach

Data versus Information

Data itself has no meaning without meta data which describes data

For example : 1012674, 28761, 153

Does not give us any information, but knowing the meta data that explains data : Staff_ID, Phone Number, room number

Information : is the data you process in a manner that makes it meaningful.

Data is what you store in database

Information is what you retrieve from database

Information Systems Department

11

Staff_ID Phone Number room number

1012674 28761 153

Page 12: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Database Approach

Database: Shared collection of logically related data and a description of this data, designed to meet the information needs of an organization.

Metadata (system catalog/data dictionary): The description of the data, used to enable program–data independence.

Data: name city birth Metadata: name - string, length<10

Khaled Dammam 01/01/70 city – string, length<15

Sara Abha 01/03/01 birth – date, format DD/MM/YY

Examples all data required for the management of student records in a university.

all data required for the management of books and borrowers in a library.

Information Systems Department

12

Page 13: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Database Approach

Logically related data comprises entities, attributes, and relationships of an organization’s information.

Entity: a distinct object( a person, place, thing, event) in the organization that is to be represented in the database.

Attribute: is a property that describes some aspect of the object that we wish to record.

Relationship: is an association between entities.

Information Systems Department

13

Page 14: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Example of a Database

Mini-world: Some part of the real world about which data is stored in a database.

Mini-world for the example: Part of a UNIVERSITY environment.

Some mini-world entities:

STUDENTs

COURSEs

SECTIONs (of COURSEs)

Grade Report

Prerequiests

Information Systems Department

14

Page 15: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Information Systems Department 15

Page 16: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Information Systems Department 16

Page 17: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Example of Database Requests

Based on the previous database:

Retrieve the transcript – a list of all courses and grades – of ‘Smith’

List the names of students who took the section of the ‘Database’ course offered In fall 2008 and their grades in that section

List the prerequisites of the ‘Database’

Information Systems Department

17

Page 18: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Example of a Database

Some mini-world relationships:

SECTIONs are of specific COURSEs

STUDENTs take SECTIONs

COURSEs have prerequisite COURSEs

INSTRUCTORs teach SECTIONs

COURSEs are offered by DEPARTMENTs

STUDENTs major in DEPARTMENTs

Information Systems Department

18

Page 19: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Database Management Systems

Database Management System (DBMS)

A software system that enables users to

create, maintain, and query the database

Most DBMSs now have facilities that make data access fast, reliable, secure and easy

Example DBMSs

Oracle

MS Access

MySQL

Information Systems Department

19

Page 20: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Application programs

Database Application : is a collection of data and

the programs that interacts with the database by

issuing an appropriate request (typically an SQL

statement) to the DBMS.

built on top of DBMS

to satisfy end users special requirements and

preferences

Information Systems Department

20

Page 21: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Examples of Database Applications

Purchases from the supermarket

PNU Student Registration

PNU Library

Saudi Airline Reservation

Purchases using your credit card

Booking a holiday at the travel agents

Using the Internet

Information Systems Department

21

Page 22: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Database System

Database System: The DBMS software together with the

data itself. Sometimes, the applications are also included.

(DB + DBMSs + Application program)

To manage large amounts of data

Efficiently

Reliably

Securely

conveniently

Information Systems Department

22

Page 23: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Database Approach

Information Systems Department

23

Page 24: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Information Systems Department 24

Page 25: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Main Characteristics of the Database Approach

1. Self-describing nature of a database system: A DBMS

catalog stores the description of the database. The

description is called (meta-data). This allows the DBMS

software to work with different databases.

2. Insulation between programs and data: Called program-data

independence. Allows changing data storage structures and

operations without having to change the DBMS access

programs (application program).

Information Systems Department

25

Page 26: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Main Characteristics of the Database Approach

3. Data Abstraction: A data model is used to hide storage

details and present the users with a conceptual view of the

database.

4. Support of multiple views of the data: Each user may see a

different view of the database, which describes only the

data of interest to that user.

Information Systems Department

26

Page 27: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Views

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

database.

A view is essentially some subset of the database.

Benefits:

Reduce complexity

Provide a level of security

Present a consistent, unchanging picture of the structure

of the database, even if the underlying database is

changed

27

Information Systems Department

Page 28: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Main Characteristics of the Database Approach

5. Sharing of data and multiuser transaction processing :

allowing a set of concurrent users to retrieve and to update

the database.

Transaction: executing program or process that includes one or more

database accesses, such as reading or updating of DB record.

Concurrency control within the DBMS guarantees that each transaction

is correctly executed or completely aborted.

Information Systems Department

28

Page 29: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Components of DBMS Environment

1. Hardware

Can range from a PC to a network of computers.

2. Software

DBMS, operating system, network software (if necessary)

and also the application programs.

3. Data

4. Procedures

Instructions and rules that should be applied to the design

and use of the database and DBMS.

5. People

Information Systems Department

29

Page 30: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Components of DBMS Environment

30

Information Systems Department

Page 31: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Information Systems Department

31

DBMS App

Program

DB

User

Requirement Procedure

DBA

Naïve End User

Application programmer

DB Designer System Analyst

H/W

Design

Communicate

Manage

Write Write

Program

Use

Use

Roles in the Database Environment

Sophisticated End User

Page 32: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Roles in the Database Environment

System Analyst: Determine the user requirements and develop the system specifications.

Database Designers:

responsible for defining the content, the structure, the constraints, and functions or transactions against the database.

Application Programmer

Implement programs meet the end user needs.

Test , debug , document, and maintain transactions.

Information Systems Department

32

Page 33: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Roles in the Database Environment

Database administrators: responsible for:

authorizing access to the database.

coordinating and monitoring the DB use.

acquiring software, and hardware resources.

monitoring efficiency of operations.

Information Systems Department

33

Page 34: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Roles in the Database Environment

End-users: they use the data for queries, reports and some of them actually update the database content.

Categories of End-users:

Naïve : (Queries / modifies data)

- they make up a large section of the end-user population.

- They use previously well-defined functions in the form of “canned transactions” against the database.

- Examples: bank-tellers or reservation clerks.

Sophisticated : Forms requests in a database query language.

Information Systems Department

34

Page 35: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Advantages of Using the Database Approach

Controlling redundancy in data storage and in

development and maintenance efforts.

Sharing of data among multiple users.

Restricting unauthorized access to data.

Information Systems Department

35

Page 36: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Advantages of Using the Database Approach

Providing backup and recovery services.

Providing multiple interfaces to different classes

of users.

Enforcing integrity constraints on the database.

Information Systems Department

36

Page 37: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Disadvantages of Database Approach

Complexity

Cost of DBMS

Additional hardware costs

Performance

Higher impact of a failure

Information Systems Department

37

Page 38: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

Information Systems Department

Page 39: LECTURE1: PRINCIPLES OF DATABASES - · PDF fileChapter1 - Objectives • Problems with file-based approach. • Database concepts. • Database Management System (DBMS). • Major

References

Main Reference:

“Database Systems: A Practical Approach to

Design, Implementation and Management.”

Thomas Connolly, Carolyn Begg.

5th Edition, Addison-Wesley, 2009.

Supplementary:

Fundamentals of Database Systems", Ramez

Elmasri, Shamkant B. Navathe, Addison

Wesley, The Latest Edition.

Information Systems Department

39