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

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

Embed Size (px)

Citation preview

Page 1: Database Management Character, file, field, record, database???

Database Management

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

Page 2: 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.

Page 3: Database Management Character, file, field, record, database???

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.

Page 4: Database Management Character, file, field, record, database???

Any problems here?

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

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

Page 5: Database Management Character, file, field, record, database???

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.

Page 6: Database Management Character, file, field, record, database???

Database Management Ex.:

Database

Prod. NameProduction ScheduleSalesNumber ProducedProduct Price

DBMS

Sales Production Marketing

(App. Progs)

Page 7: Database Management Character, file, field, record, database???

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

DATABASE MANAGEMENT SYSTEMS

• Four components of a DBMS

Page 8: Database Management Character, file, field, record, database???

BUT...

• Expensive.• Difficult.• Slow / inefficient.

Page 9: Database Management Character, file, field, record, database???

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

Page 10: Database Management Character, file, field, record, database???

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 …

Page 11: Database Management Character, file, field, record, database???

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

Page 12: Database Management Character, file, field, record, database???

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

Page 13: Database Management Character, file, field, record, database???

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.

Page 14: Database Management Character, file, field, record, database???

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

Page 15: Database Management Character, file, field, record, database???

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

THE VALUE OF QUALITY INFORMATION

• Five common characteristics of high-quality information

Page 16: Database Management Character, file, field, record, database???

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

THE VALUE OF QUALITY INFORMATION

• Low-quality information example

Page 17: Database Management Character, file, field, record, database???

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

Page 18: Database Management Character, file, field, record, database???

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

Page 19: Database Management Character, file, field, record, database???

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.

Page 20: Database Management Character, file, field, record, database???

Database StructuresDatabase Structures

Dept

A

B

C

Empno Dept

1 A

2 B

3 C

Relational Structure

Network StructureHierarchical Structure

Relation

Page 21: Database Management Character, file, field, record, database???

Pros and Cons

Speed ==>

Ad

Hoc

Fle

xibi

lity

==

>

Relat.

Net.

Hier.

Obj.

Page 22: Database Management Character, file, field, record, database???

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

Page 23: Database Management Character, file, field, record, database???

Data Flow Diagrams (“DFD”)

Data Flow

Process

File or Data Store

Source or Entity

Page 24: Database Management Character, file, field, record, database???

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

Page 25: Database Management Character, file, field, record, database???

Dept. Projects Dept. Employee

Entity Relationship Diagrams

works on

“one” “many”“zero”

* NameTitleAddress

* ProjectDeadlineResources

Page 26: Database Management Character, file, field, record, database???

New Names, Same Ideas

• Data Mining, OLAP• Data Warehousing

Page 27: Database Management Character, file, field, record, database???

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

Page 28: Database Management Character, file, field, record, database???

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.

Page 29: Database Management Character, file, field, record, database???

Data Warehouses & Data Marts

TPS& other

operational systems

DataWarehouse

Data Mart(Marketing)

Data Mart(Engineering)

3rd party data

= query, OLAP, mining, etc.

= operational clients