Database Management Character, file, field, record, database???

Post on 02-Apr-2015

250 views 1 download

Tags:

transcript

Database Management

Character, file, field, record, database???

What’s “File Processing”?

• The “old” way of doing things; still often used in practice.

• Separate information stored on separate files.

File Processing Example:Sales Production Marketing

Knows howmany ofProducts A,B, and C havebeen sold.File storesProd. Name,ProductionSchedule,and Sales.

Knows howmuch ofProducts A,B, and C havebeen produced.File storesProd. Name,ProductionSchedule, andNumber Produced.

Knows theprice ofProducts A,B, and C.File storesProd. Nameand ProductPrice.

Any problems here?

• Duplication (redundancy).• Inconsistency.• Does anyone know how much money we

made? No integration.• Set format. Data dependence. Y2K!!

Database ManagementDatabase Management System (DBMS)

• Provides one integrated repository for data to be stored and queried.

• Standards for data can be defined and enforced.

• Reports and queries are easy (er).• SQL, etc.

Database Management Ex.:

Database

Prod. NameProduction ScheduleSalesNumber ProducedProduct Price

DBMS

Sales Production Marketing

(App. Progs)

McGraw-Hill/Irwin © 2006 The McGraw-Hill Companies, Inc. All rights reserved.

DATABASE MANAGEMENT SYSTEMS

• Four components of a DBMS

BUT...

• Expensive.• Difficult.• Slow / inefficient.

Another Look(thanks to John Gallaugher, Boston College)

• Database• a collection of related data. Usually organized according to topics:

e.g. customer info, products, transactions

• Database Management System (DBMS)– a program for creating & managing databases; ex. Oracle, MS-

Access, Sybase

DBMS - the program. Manages interaction with databases.

database - the collection of data.Created and defined to meet theneeds of the organization.

Client - makes requests of the DBMS server

request

response

Server - responds to client requests

A Simple Database

• File/Table• Customers

• Field/Column• 5 shown: CUSTID, FIRST, LAST, CITY, STATE

• Record/Row• 5 shown: one for each customer

CUSTID FIRST LAST CITY STATE …2001 John Gallaugher Newton MA …2002 Abby Johnson Boston MA …2003 Warren Buffet Omaha NE …2004 Peter Lynch Marblehead MA …2005 Charles Schwab San Francisco CA …

LAST CITY STATE BUY/SELLSTOCK SHARES PRICE DATE TIME CUSTIDGallaugher Newton MA Buy MSFT 1000 90 1/4 12/24/98 12:01 PM 2001Gallaugher Newton MA Buy INTC 2400 80 1/8 7/3/99 10:51 AM 2001Gallaugher Newton MA Sell IBM 3000 114 3/8 7/1/99 9:03 AM 2001Johnson Boston MA Sell IBM 3000 110 1/8 6/30/99 4:53 PM 2002Johnson Boston MA Sell INTC 2000 94 7/8 8/30/99 3:15 PM 2002Buffet Omaha NE Buy INTC 1500 90 3/8 7/2/99 11:27 AM 2003Buffet Omaha NE Buy IBM 1700 101 7/8 1/4/99 2:02 PM 2003Buffet Omaha NE Sell AAPL 1900 18 1/2 2/14/99 5:00 PM 2003Lynch Marblehead MA Buy AAPL 2000 19 2/14/99 5:30 PM 2004Lynch Marblehead MA Sell AAPL 10000 21 7/8 3/15/99 11:44 AM 2004Schwab San Francisco CA Buy MSFT 4500 101 1/8 1/15/99 12:38 AM 2005Schwab San Francisco CA Buy INTC 17000 80 1/8 7/2/99 4:53 PM 2005

A More Complex Example

• Entry & Maintenance is complicated• redundant data exists, increases chance of error,

complicates updates/changes, takes up space

CUSTID FIRST LAST CITY STATE2001 John Gallaugher Newton MA2002 Abby Johnson Boston MA2003 Warren Buffet Omaha NE2004 Peter Lynch Marblehead MA2005 Charles Schwab San Francisco CA

Normalize Data:Remove Redundancy

One

Many

CUSTID BUY/SELLSTOCK SHARES PRICE DATE TIME2001 Buy MSFT 1000 90 1/4 12/24/98 12:01 PM2001 Buy INTC 2400 80 1/8 7/3/99 10:51 AM2001 Sell IBM 3000 114 3/8 7/1/99 9:03 AM2002 Sell IBM 3000 110 1/8 6/30/99 4:53 PM2002 Sell INTC 2000 94 7/8 8/30/99 3:15 PM2003 Buy INTC 1500 90 3/8 7/2/99 11:27 AM2003 Buy IBM 1700 101 7/8 1/4/99 2:02 PM2003 Sell AAPL 1900 18 1/2 2/14/99 5:00 PM2004 Buy AAPL 2000 19 2/14/99 5:30 PM2004 Sell AAPL 10000 21 7/8 3/15/99 11:44 AM2005 Buy MSFT 4500 101 1/8 1/15/99 12:38 AM2005 Buy INTC 17000 80 1/8 7/2/99 4:53 PM

Customer Table

Transaction Table

Key Terms• Relational DBMS

• manages databases as a collection of files/tables in which all data relationships are represented by common values in related tables (referred to as keys).

• a relational system has the flexibility to take multiple files and generate a new file from the records that meet the matching criteria (join).

• SQL - Structured Query Language• Most popular relational database standard. Includes a

language for creating & manipulating data.

Using SQL for Querying

• SQL (Structured Query Language)Data language English-like, nonprocedural, very user friendly languageFree format

Example:SELECT Name, SalaryFROM EmployeesWHERE Salary >2000

McGraw-Hill/Irwin © 2006 The McGraw-Hill Companies, Inc. All rights reserved.

THE VALUE OF QUALITY INFORMATION

• Five common characteristics of high-quality information

McGraw-Hill/Irwin © 2006 The McGraw-Hill Companies, Inc. All rights reserved.

THE VALUE OF QUALITY INFORMATION

• Low-quality information example

McGraw-Hill/Irwin © 2006 The McGraw-Hill Companies, Inc. All rights reserved.

THE VALUE OF QUALITY INFORMATION

• The four primary sources of low-quality information include:

1. Online customers intentionally enter inaccurate information to protect their privacy

2. Information from different systems that have different information entry standards and formats

3. Call center operators enter abbreviated or erroneous information by accident or to save time

4. Third party and external information contains inconsistencies, inaccuracies, and errors

McGraw-Hill/Irwin © 2006 The McGraw-Hill Companies, Inc. All rights reserved.

Understanding the Costs of Low-quality Information

• Potential business effects resulting from low-quality information– Inability to accurately track customers– Difficulty identifying valuable customers– Inability to identify selling opportunities– Marketing to nonexistent customers– Difficulty tracking revenue due to inaccurate invoices– Inability to build strong customer relationships – which

increases buyer power

Structures• Hierarchical: The old way. “Tree”.

• Access elements by moving down tree.• One-to-many.

• Network: Criss-cross patterns.• Many-to-many.

• Relational: a common element relates “tables” to one another. Permits “ad hoc”.

• Object-oriented: “objects” have data, processes, and properties “encapsulated” in them.

Database StructuresDatabase Structures

Dept

A

B

C

Empno Dept

1 A

2 B

3 C

Relational Structure

Network StructureHierarchical Structure

Relation

Pros and Cons

Speed ==>

Ad

Hoc

Fle

xibi

lity

==

>

Relat.

Net.

Hier.

Obj.

Data DictionariesData Dictionaries

The Data Dictionary

• A reference work of data about data (metadata) compiled by the systems analyst to guide analysis and design.

• As a document, the data dictionary collects, coordinates, and confirms the meaning of data terms to various users throughout the organization.

• Documentation, Elimination of data redundancy• Validate the data flow diagram for completeness and accuracy• Provide a starting point for developing screens and reports• Determine contents of data stored in files• Develop the logic for data flow diagram processes

Uses of the Data Dictionary

Data Flow Diagrams (“DFD”)

Data Flow

Process

File or Data Store

Source or Entity

1

2

3

Tenant

NewTenantProcess

CollectionProcess

DelinquentProcess

Lease

D1 Tenant FileTenant InfoDFD Example: Apartment Rental

Payments

BankBank Deposit

Receipt

Ext.Mgr

Cash Report

D1 Tenant File

UnpaidCharges

DelinquencyReport

TenantInfo

Delinquencies

Copy of lease

Notice

Dept. Projects Dept. Employee

Entity Relationship Diagrams

works on

“one” “many”“zero”

* NameTitleAddress

* ProjectDeadlineResources

New Names, Same Ideas

• Data Mining, OLAP• Data Warehousing

Data Mining• automated information discovery process,

uncovers important patterns in existing data• can use neural networks or other approaches.

Requires ‘clean’, reliable, consistent data. Historical data must reflect the current environment.

• e.g. “What are the characteristics that identify when we are likely to lose a customer?”

• OLAP is user-driven discovery

Warehouses & Marts• Data Warehouse

• a database designed to support decision-making in an organization. It is batch-updated and structured for fast online queries and exploration. Data warehouses may aggregate enormous amounts of data from many different operational systems.

• Data Mart– a database focused on addressing the concerns of a specific

problem or business unit (e.g. Marketing, Engineering). Size doesn’t define data marts, but they tend to be smaller than data warehouses.

Data Warehouses & Data Marts

TPS& other

operational systems

DataWarehouse

Data Mart(Marketing)

Data Mart(Engineering)

3rd party data

= query, OLAP, mining, etc.

= operational clients