Top Banner
Database Design and Implementation CIS 591 Dr. Stephen C. Hayne
36

Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Dec 13, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Database Design and Implementation

CIS 591

Dr. Stephen C. Hayne

Page 2: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Outline

Historical development Terms and concepts Objectives of database systems

Page 3: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Timely and Accurate Information

United Airlines (290,000 flight coupons per day and electronic ticketing):– Assemble information dynamically– Get multiple perspectives on the data to

decide how to handle discrepancies– Increase accuracy on revenue figures– Improve scheduling, fares and

marketing

Page 4: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Databases Today

Big business in software industry ($>10B/year in US alone)

Field is still young (<30 years) Rapidly changing environment DBs are now pervasive

Page 5: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Payroll File

Soc.Sec.# Name Hours Rate

000-00-0000 Barbie 40 10.00

123-45-6798 Ken 40 20.00

987-65-4321 Barney 20 5.00

FieldsPrimary key

A “logical” record

Page 6: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

COBOL Record Description

01 EMPLOYEE RECORD

03 SS# PICTURE X(11)

03 NAME PICTURE A(20)

03 HOURS PICTURE 9(2)

03 RATE PICTURE 99V99

Page 7: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Compiling a Program

COBOL Program

COBOL Compiler

Executable Program

Page 8: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Base Salary Added

Soc.Sec.# Name Hours Rate Salary

000-00-0000 Barbie 40 10.00 1000

123-45-6798 Ken 40 20.00 2000

987-65-4321 Barney 20 5.00 1

What does this imply for the program?

Page 9: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

It means that...

We must modify » the file itself» the COBOL program

Re-compile the program Re-comple any program using that file Y2K anyone?

Page 10: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

In the beginning (1960’s)

Sue Programmer

Payroll Program

Payrollfiles

Joe Programmer

Benefits Program

Benefitsfiles

Page 11: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Maintenance

Sue Programmer

Payroll Program

Payrollfile (mod)

Joe Programmer

Benefits Program

Benefitsfile

Mod

Mod

Expense Report

Expensefile

Page 12: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

And it goes on....

Sue Programmer

Payroll Program

Payrollfile

Joe Programmer

Benefits Program

Benefitsfile

Mod

Mod

Expense Report

Expensefile

Thelma

Louise

Expensefile

Page 13: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Data File Summary

Data is separated and isolated. Data is often duplicated. Application programs are dependent on

file formats. Files are often incompatible. Data often not represented in user's

format.

Page 14: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Data Independence Decouple data from programs

PayrollProgram

BenefitsProgram

DBMS

IntegratedDatabase

Page 15: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Database Management Systems

DBMS: The software package» SQL Server, Oracle, Informix, DB2,

Sybase, Access, etc. Treat data as an organizational asset Manage data independently of programs Provide better access Provide information for management

Page 16: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Data as an Organizational Asset

Record keeping Accounting Managing / Decision Making

» Strategy» Quality» Customer service» Data mining» Business Process Reengineering

Page 17: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Strategic

Tactical

Operational

Organization LevelBroadLong-TermUnstructuredExternally-OrientedVolatileUnpredictable

NarrowShort-TermStructuredInternally-OrientedStablePredictableFinance Production Marketing

Database Applicability

Page 18: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Definition of a Database

A database is a model of a model A database is a self-describing

collection of integrated records» data» meta-data» indexes» application meta-data

Page 19: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Database Terms Entity (instance)

» an individual “thing” about which data is stored– a student, a car, a computer, an employee

» represented in a record Attribute

» a characteristic of an entity– student name, color of a car, make of computer

» represented in a field Entity type or class

» a set of entities of the same kind– the students at ASU, the set of pickup trucks

» represented in a relation or table (file)

Page 20: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Payroll Relation (Table)

Soc.Sec.# Name Hours Rate

000-00-0000 Barbie 40 10.00

123-45-6798 Ken 40 20.00

987-65-4321 Barney 20 5.00

AttributesPrimary key

Tuple (row)

Page 21: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Controlling Redundancy - effort duplication, wasted storage, inconsistencies

Standardization Data Sharing - concurrency control, user views Multiple Interfaces - query language, program interface,

menus, natural language Data Relationships Integrity Constraints - data types/relationships Backup and Recovery Productivity

DBMS Objectives

Page 22: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Three Schema Architecture

ExternalView

ExternalView

Conceptual Schema

Internal Schema

DBMS Architecture

Logical Independence

Physical Independence

Page 23: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Logical Independence - ability to changeconceptual schema without alteringexternal schemas

Physical Independence - ability to change internal schema with altering conceptual (or external) schemas

Increased overhead due to mapping

Data Independence

Page 24: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

External Level

User views» What each user or user group “sees”» Only the entities, attributes and

relationships relevant to each user» May have aliases for attributes

– Customer vs. Patron

» May have different output formats– Negative values in red or in parentheses

Page 25: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Conceptual Level

The “logical schema”» ALL the entities, attributes and relationships» The constraints on the data» Semantic information about the data» Security and integrity information

Page 26: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

The Internal Level

The physical schema Storage space allocation for data and

indexes Record descriptions Data compression and data encryption

techniques

Page 27: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Objectives of Database Systems

Access Flexibility» Query languages (DML)

– SQL (sometimes pronounced sequel)– QBE

» Embedded languages– SQL– CODASYL DML

» Forms and Reports

Page 28: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Objectives of Database Systems (Cont’d)

Data Integrity» Correct» Consistent» Current» Critical for users!

Page 29: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Objectives of Database Systems (Cont’d)

Data Security» Prevent unauthorized access» Prevent accidental damage» Recover if damage occurs

Page 30: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Objectives of Database Systems (Cont’d)

Reduced Data Redundancy» Store each datum in only one place » Disk space» Update problems

– Time– Data Integrity

Page 31: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Objectives of Database Systems (Cont’d)

Data Sharing» only among appropriate users» Compared to paper

– Paper in one place at a time– Databases shared by many at the same time– Can redesign systems

» Politically difficult– Who “owns” the data?– Who sees the data?– Who updates the data?

Page 32: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Objectives of Database Systems (Cont’d)

Relationships» among entities» For example, customers and orders.

– Each customer is related to zero, one or more orders.– Each order is related to one customer

Customer Order

Page 33: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Objectives of Database Systems (Cont’d)

Standardization» Data dictionary» Standard codes (M=Male, F=Female)» Standard formats (Gender is one letter)» Standard definitions

– What is a proposal?– What is a full-time student?

Page 34: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Objectives of Database Systems (Cont’d)

Personnel productivity» Share data definitions and databases» Share code» Don’t reinvent the wheel

Page 35: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Some Disadvantages

Complex, large, expensive software Hardware and conversion costs Performance problems Complex application development

» Large systems» Organizational considerations

Page 36: Database Design and Implementation CIS 591 Dr. Stephen C. Hayne.

Summary

Data is an important resource. Databases seek several objectives. Databases must be well-designed. Databases must be well-managed. The database environment is complex.