Jerry Post Copyright © 2001 1 Database Management Systems Chapter 1 Introduction.

Post on 20-Dec-2015

213 views 0 download

Tags:

transcript

1

Jerry PostCopyright © 2001

Database Management Database Management SystemsSystems

Chapter 1

Introduction

2

DDAATTAABBAASSEE

Goal: Build a Business Application

Tools:Database DesignSQL (queries)Programming

Des

ign

SQ

L

Pro

gram

Des

ign

SQ

L

Pro

gram

Best:Spend your timeon design and SQL.

Worst:Compensate for poor designand limited SQL with programming.

3

DDAATTAABBAASSEE

DBMS: Database Management System

DatabaseA collection of data stored in a standardized format,

designed to be shared by multiple users.

Database Management SystemSoftware that defines a database, stores the data, supports

a query language, produces reports, and creates data entry screens.

4

DDAATTAABBAASSEE

Drawbacks of old File methods

Uncontrolled DuplicationWastes spaceHard to update all files

Inconsistent data Inflexibility

Hard to change dataHard to change programs

Limited data sharing Poor enforcement of standards Poor programmer productivity Excessive program maintenance

5

DDAATTAABBAASSEE

File Method Problems

Files defined in programCannot read file without

definitionHard to find definitionEvery time you alter file,

you must rewrite codeChange in a program/file

will crash other codeCannot tell which

programs use each file

Multiuser problemsConcurrencySecurity

AccessBackup & Restore

Efficiency IndexesProgrammer talent

System Application

6

DDAATTAABBAASSEE

Old File Method/3GL

Data Definition File 1 … File 2 …

Data Definition File A File 2 File C …

Pay History

Benefits

Employee

EmployeeChoices

FilesProgramsPayroll

Benefits

7

DDAATTAABBAASSEE

Example of File Method v DBMS

File Division01 Employees 02 ID 02 Name 02 Address

01 Department 02 ID 02 . . .

COBOL

112 Davy Jones 999 ElmStreet . . . 113 Peter Smith101 Oak St . . .

Employee File

More programsFile Division01 Employees...

Add to file (e.g.Cell phone)Write code to copy employee file

and add empty cell phone slot.Find all programs that use

employee file.Modify file definitions.Modify reports (as needed)Recompile, fix new bugs.

Easier: Keep two employee files?

02 Cell Phone

8

DDAATTAABBAASSEE

Advantages of Database Approach

Minimal data redundancy. Data consistency. Integration of data. Sharing of data. Enforcement of standards. Ease of application development. Uniform security, privacy and integrity. Data independence.

9

DDAATTAABBAASSEE

Database Management Approach Data is most important

Data defined firstStandard format

Access DB through DBMSQueries, Reports, FormsApplication Programs3GL Interface

Data independenceChange data definition

without changing codeAlter code without

changing dataMove/split data without

changing code

All Data

DBMS

Program1 Program2QueriesReports

10

DDAATTAABBAASSEE

Modifying Data with DBMS

Add cell number to employee tableOpen table definitionAdd data element If desired, modify reports

Use report writerNo programming

Existing reports, queries, code will all run as before with no changes.

Field Name Data Type Description

EmployeeID Number Autonumber..TaxpayerID Text Federal IDLastName TextFirstName Text . . . Phone Text . . .

CellPhone Text Cellular . . .

11

DDAATTAABBAASSEE

DBMS Features/Components Database engine

StorageRetrievalUpdate

Query Processor Data dictionary Utilities Security

Report writer Forms generator (input

screens) Application generator Communications 3GL Interface

12

DDAATTAABBAASSEE

DBMS Engine, Security, Utilities

DataTables

DatabaseEngine

ProductItemID Description887 Dog food946 Cat food

OrderOrderID ODate9874 3-3-979888 3-9-97

CustomerCustomerID Name1195 Jones2355 Rojas

ProductItemID Integer, UniqueDescription Text, 100 charCustomerCustomerID Integer, UniqueName Text, 50 char

SecurityUser IdentificationAccess Rights

Utilities

Concurrency andLock Manager

Backup andRecovery

Administration

DataDictionary

13

DDAATTAABBAASSEE

Database Tables (Access)

14

DDAATTAABBAASSEE

Database Tables (Oracle)

15

DDAATTAABBAASSEE

DBMS Query ProcessorAll Data

Database EngineData Dictionary

Query Processor

16

DDAATTAABBAASSEE

DBMS Report WriterAll Data

Database EngineData Dictionary

Query Processor

Report Writer

ReportFormat

and Query

17

DDAATTAABBAASSEE

Report Writer (Oracle)

18

DDAATTAABBAASSEE

DBMS Input FormsAll Data

Database EngineData Dictionary

Query Processor

Form Builder

InputForm

Design

19

DDAATTAABBAASSEE

DBMS Components

All Data

Database EngineData Dictionary

Security

Query Processor

FormBuilder

ReportWriter

CommunicationNetwork

3GLConnector

Program

ApplicationGenerator

20

DDAATTAABBAASSEE

Examples of Commercial Systems

Oracle Ingres Informix (Unix) DB2, SQL/DS (IBM) Access (Microsoft) SQL Server (Microsoft +) Many older (Focus, IMS, ...) Many limited PC (dBASE, Paradox, …)

21

DDAATTAABBAASSEE

Hierarchical DatabaseCustomers

Orders

Item Description Quantity998 Dog Food 12764 Cat Food 11

Items

Customer

Order

Items Ordered

To retrieve data, you must start at the top (customer). When you retrieve a customer, you retrieve all nested data.

22

DDAATTAABBAASSEE

Network Database

Customer

OrderItems

Ordered

Items

Entry point

Entry point

23

DDAATTAABBAASSEE

Relational Database

Customer(CustomerID, Name, …

Order(OrderID, CustomerID, OrderDate, …

ItemsOrdered(OrderID, ItemID, Quantity, …

Items(ItemID, Description, Price, …

24

DDAATTAABBAASSEE

Object-Oriented DBMSCustomer

CustomerIDName… Add CustomerDrop CustomerChange Address

OrderOrderIDCustomerID… NewOrderDeleteOrder…

OrderItemOrderIDItemID… OrderItemDropOrderItem…

ItemItemIDDescription… New ItemSell ItemBuy Item …

GovernmentCustomer

ContactNameContactPhoneDiscount, …

NewContact

CommercialCustomer

ContactNameContactPhone…

NewContact

25

DDAATTAABBAASSEE

Why don’t all developers use a DBMS?

Most new projects (in last 5 years) do use a DBMS Need specialized personnel

ProgrammersDesigners/AnalystsDatabase administrators

Need to define data for organization Cost

PC: $400 - $2000Large: $100,000 +

26

DDAATTAABBAASSEE

Application development

Modeling data – ch 2 and 3 User interface design (forms and reports) – ch 4,5,6. Operational design – ch 7 and 8. DB tuning – ch 9. DB admin and security – ch 10. Distributed DB – ch11.

27

DDAATTAABBAASSEE

Building the Right System: Feasibility Costs

Up-front/one-time Software ($ millions !) Hardware Communications Data conversion Studies and Design Training

On-going costs Personnel Software upgrades Supplies Support Software & Hardware

maintenance

Benefits Cost Savings

Software maintenance Fewer errors Less data maintenance Less user training

Increased Value Better access to data Better decisions Better communication More timely reports Faster reaction to change New products & services

Strategic Advantages Lock out competitors

Easy to estimate Hard to value