it 244 database management system lecture 1 – 14 / 02 /07 course information & introduction to...

46
IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Upload: moses-mcdowell

Post on 26-Dec-2015

224 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

IT 244 Database Management System

Lecture 1 – 14 / 02 /07

Course Information

&

Introduction to Database & DBMS

Page 2: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Topic 1 – Introduction

• Evolution of Database Systems:– Data >> Database vs Database Management

– Compare ways DATA is organized:• Word processor (document production)• Spreadsheets (numerical analysis)• Traditional File Management (mini computers storage

& retrieval)• Database (data management)

– Advantages and Disadvantages

Page 3: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Ways data is organized in… Word Processor Spreadsheet Traditional FS Database

Characters in group of words

Data are placed in unique cells

Data is stored physically in one location – database

Words in group of line

Cells arranged in rows and columns

Special DBM is used to manage the storage and access to the data

Lines in group of paragraph

R & C in different worksheet in one spreadsheet

Data are all in one database but kept in separate logical units or tables.

Paragraph in group of pages ,, in files

Data items have data types like $, text etc.

Information about one entity on one file Each file is accessed by its own specially written program

DBMS then provides users with one interface to access the database with presentable information as preferred.

Free format Unstructured

More uniformity & Structured, progress

Improvement over spreadsheets

Page 4: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Spreadsheet Format – Store data in rows and columns :

Patient Adm. Date Disc. Date Bed No.

Ward No.

Doctor Contacts

John Smith 12-03-98 17-03-98 21 2 Black 23432 Jim Words 12-03-98 22-03-98 22 2 Black 23432 James Cola 12-03-98 22-03-98 23 3 Price 56783 Richard Sam 15-03-98 30-03-98 12 1 Carey 56765 Judy Parson 20-04-98 25-04-98 14 3 Samson 67876 Lezek Mash 25-05-98 30-05-98 3 4 Price 56789

Several things to note about the above table:

Data to be stored has uniform format. Same kind of information about each patient

1. File size will increase as the number of patient records increases

2. Frequently accessing the table for new or existing patients 3. Table will be useful for all like the doctor or administrators4. Other people may need print out of the information .

Page 5: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Potential problems that can arise:

• Patients increase – file size too so access to the table will become slower and slow when access concurrently;

• Takes time to manipulate the table ie. Get specific information, correct an error, repetition of data will have to be dealt with.

Page 6: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Traditional File Systems

• Information system specialist became aware of the problems

• So they devised ways of managing them.• Rather then keeping data in a single large file, • Data was separated into many different files according to

the nature of the information to be stored.• Then special software programs were written to manage

the files.• These programs could perform tasks such as:

– add new records– update old ones;– search for selected data within files– and deleted unwanted records.

Page 7: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Traditional File System

• Thus: The data about the Hospital patients in the spreadsheet can be separated into the following files under the traditional file system.

 File Information StoredPatients - Surname, First name, age, date

admitted, date dischargedDoctor - Surname, First name, Phone contactWard - Ward number, number of roomsRoom - Room number, beds, ward number

Page 8: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Traditional method of file management

Patients

Doctors

Wards

Rooms

Patients program

Doctors program

Wards program

Rooms program

Users

Users

Users

Users

Page 9: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Traditional method of file management

• Although this is an improvement over the spreadsheet method of storing and accessing data, there are still some problems.

• For instance, information about the wards is closely related to the information about rooms but they are in different files. How do you link them ? Often extra programming effort.

• Not every organization can afford to have a programmer• Getting access to the required information often takes a

number of steps.• To speed up the retrieval of information you can create

indexes for the file and/or split it up to avoid repetition of information and reduce the total size of the file.

Page 10: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Disadvantages of TFMSince data is stored in many related files you can

end up with: • Data redundancy – keeping many copies of the same

type of data• Data inconsistency – updating some of the copies but not

the others• Data Dependency – data access is tied to the program so

change in data will also change in programs• Excessive maintenance and upgrade costs – Modifying

the programs and structure of the data files require a lot of effort.

Page 11: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

The Evolution of Database System

• What is a database:- is nothing more than a collection of information that exists over a long period of time.

• The term database refers to a collection of data that is managed by a DBMS

Page 12: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

DATABASE

A collection of data that is managed and organized by a DBMS. Not all collection of data are databases. Databases have the following characteristics:

1.  They represent some aspects of the real world• Hospital patients

2. They are logically coherent and have some meaning• Related in some way• Information has some meaning.

3. They are created for specific purposes.• Information for a specific purposes.

Page 13: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Database Approach

Ward

Doctors

Patients

Room

DatabaseManagement

System

User 1User 3

User 6

User 9

User 12

Data are all in one database but kept in a separate logical units or tables.The DBMS provides users with one interface to access the database andpresent the database information to each users according to preferences.

Page 14: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Advantages of Database approach

1. Data independence – data items no longer tied to the programs

2. Reduction of data redundancy and inconsistency – Only one copy of each data item is stored

3. Consolidation of data management – Just one software program DBMS to manage access to the database

4. Can be used in multi-user environment – More people can used at once

5. Security restrictions can be applied. – Security features can be build into the DBMS to restrict and protect the data.

6. The integrity of the data can be maintained – accuracy and reliability of the data

7. Standard can be enforced – adhere to organizational policies

Page 15: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

What is a Database Management System (DBMS)

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

In other words:A collection of programs that enables you to store, modify, and extract information from a database. (Webopedia Computer Dictionary)

Page 16: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

DBMS

• DBMS is a powerful tool for creating and managing large amounts of data efficiently and allowing it to keep over long periods of time safely

• These systems are among the most complex types of software available.

Page 17: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Capabilities that a DBMS provides

• Persistent Storage – like a file system – support very large amounts of data that exists independently of any processes that are using the data.

- DBMS goes far beyond the file system in providing flexibility, such as data structures that support efficient access to very large amounts of data

Page 18: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Capabilities that a DBMS provides

• Programming Interface :- DBMS allows the user or an application program to access and modify data through a powerful query language

- Again the advantage of a DBMS over a file system is the flexibility to manipulate stored data in much more complex ways than the reading and writing of files.

Page 19: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Capabilities that a DBMS provides

• Transaction Management :- DBMS support concurrent access to data –i.e. simultaneous access by many distinct processes (called transactions) at once

Page 20: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

DBMS was expected to:-

• Allow user to create new database and specify schema

• Give users the ability to query the data

• Support the storage of very large amount of data

• Control access to data from many users at once

Page 21: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Early Database Management System

• First commercial database management systems appeared in the late 1960’s

• These systems evolved from file system (File systems store data over a long period of time and they allow the storage of large amounts of data)

Page 22: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Application of DBMS

• Airline Reservation SystemsIn this type of System, the item of data include:-

- Reservations by customers - Information about flights – (airports they fly

from and to, departure and arrival time, aircraft flown etc)

- Information about tickets (such as prices, requirements and availability)

Page 23: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Application of DBMS

• Banking Systems

- Include names and addresses of customers, accounts, loans etc.

- as with airlines reservation system, we expect many tellers and staff or customers querying and modifying the bank’s data at once

Page 24: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Summary

• Course administrative matters

• How the concept of Database approach developed

• Files structure

• Users

• Database

• DBMS

Page 25: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

• End of Lecture

Page 26: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Problems EDBMS

• File systems do not generally guarantee that data can not be lost if it is not backed up

• They do not support efficient access to data items whose location in a particular file is not known

• File systems do not directly support a query language for the data files

Page 27: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Problems EDBMS

• Their support for a schema for the data is limited to the creation of directory structures for files

• File system do not satisfy concurrent access to files by several users or processes

Page 28: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Simultaneous access• Avoiding consequences of simultaneous

access DBMS supporti) isolation: - the appearance that

transactions execute one at a time

ii) atomicity:- the requirement that transactions either completely

or not at alliii) durability:- the ability to recover from

failure or errors of many types

Page 29: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Application of DBMS

• The first important applications of DBMS were one where:-

- Data was composed of many small items

- Many queries or modifications were made

Page 30: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Application of DBMS

• IT IS VITAL THAT SIMULTANEOUS ACCESSES TO AN ACCOUNT NOT CAUSE THE EFFECT OF A TRANSACTION TO BE LOST.

• FAILURE CANNOT BE TOLERATED.

Page 31: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Relational Database Systems

• Following a famous paper written by Ted Codd in 1970’s

• Database system changed significantly

• Codd proposed that database systems should present the user with a view of data organized as tables called relations

Page 32: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Relational Database Systems

• Behind the scenes, there might be a complex data structure that allow rapid response to a variety of queries. But unlike the user of earlier database systems, the user of a relational system would not be concern with the storage structure. Queries could be expressed in a very high-level language, which greatly increased the efficiency of database programmers

Page 33: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Relational Database Systems

• Relations and Tables- Columns are headed by attributes which describe the entries in the column

Eg. A relation named Accounts recording Bank Account, Balance and Type might look like:

Acc No

Balance Type

123 100.00 Sav

456 2000.00 Check

… … …

Page 34: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Relational Database Systems

• Heading the columns are the attributes

- Account No

- Balance

-Type

Page 35: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Relational Database Systems

• Below the attributes are the Rows or Tuples

• The table show two tuples of the relation explicitly, and the dots below them suggest that there would be many more tuples.

Page 36: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Relational Database Systems

• Suppose we want to know the balance of account 456. We could ask this query in SQL as follows

SELECT account No

FROM Accounts

WHERE accountNo = 456

Page 37: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Relational Database Systems

• Do NOT expect that this example is enough to make you an expert SQL programmer, but it should convey the high-level nature of the SQL “Select-From-Where” statement

Page 38: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Relational Database Systems

• In principle, they ask the DBMS to:1. Examine all the tuples of the Relation Accounts mentioned in the FROM clause2. Pick out those tuples that satisfy some

criterion indicated in the WHERE clause and3. Produce as an answer certain attributes of

those tuples as indicated in the SELECT clause

In practice, the system must “optimize” the query and find an efficient way to answer the query, even though the relations involved in the query may be very large.

Page 39: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Smaller and Smaller Systems

• Originally, DBMS were large, expensive software running on large computers

• Size was necessary because to store large amount of data require large computer system

• To day many gigabytes fit on a single disk• Size Decrease, Capacity and power

increases.

Page 40: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Bigger and Bigger Systems

• On the other hand, a gigabyte isn’t much data.• Corporate database often occupy hundreds of

gigabyte• As storage become cheaper people find new

reasons to store greater amount of data• Database no longer focus on storing simple data

item (integer or short string of characters) – but can store images, audio and video and many other kind of data.

Page 41: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Bigger and Bigger Systems

• Handling such large database require technological advanceseg. Database of modest size are today stored on arrays of disks which are called secondary storage device. (compared to main memory which is primary storage)

• The fact that database systems routinely assume data is too big to fit in main memory and must be located primarily on disk at all times

Page 42: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Bigger and Bigger Systems

• Trends that allow database systems to deal with large amounts of data faster:- Tertiary Storage:-

- tertiary storage devices perhaps storing a tera-byte each.

- require much more time to access a given item than does a disk

- involve transporting an object, upon which the desired data item is stored to a reading device

Page 43: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Bigger and Bigger Systems

- Parallel Computing- the ability to store enormous volumes of data is important but it would be of little use if we could

not access large amounts of data quickly

- thus very large databases also require speed enhancers.

- parallel Computing handle such problem

Page 44: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Client Server and Multi-Tier Architectures

• Client – server architecture (Two-Tier) – a request by one process (the client) are send to another process (the server) for execution

• N-Tier –DBMS continues to act as a server, but its client is typically an application server.

Page 45: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Client Server and Multi-Tier Architectures

• Application server in a N-Tier manage connections to the database, transactions, authorization and other aspects.

• Application Servers in turn have clients such as Web servers, which support end-users or other application.

Page 46: IT 244 Database Management System Lecture 1 – 14 / 02 /07 Course Information & Introduction to Database & DBMS

Summary

• The worlds of Database Systems

• The evolution of Database Systems

• Early Database Management Systems

• Relational Database System

• Smaller and Smaller Systems

• Bigger and Bigger Systems

• Client Server and Multi-Tier Architecture