Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

52
Concepts of Database Concepts of Database Management, Fifth Management, Fifth Edition Edition Chapter 1: Chapter 1: Introduction to Introduction to Database Management Database Management

Transcript of Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

Page 1: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

Concepts of Database Concepts of Database Management, Fifth Management, Fifth

EditionEdition

Chapter 1: Chapter 1:

Introduction to Introduction to Database ManagementDatabase Management

Page 2: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

2

Objectives

Why study database management? Introduce Premiere Products, the company

that is used as the basis for many of the examples throughout the text

Introduce basic database terminology

Describe database management systems

Explain the advantages and disadvantages of database processing

Introduce Henry Books, the company that is used in the case that runs throughout the text

Page 3: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

3

Why manage data?Why manage data?

Changing view of data

Higher costs of lost data

Encouragement of “team problem-solving”

Flexible reporting Integrating it into

decision-making better

Page 4: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

4

Background Info Background Info DBMS software

$25B/year industry Networked DBMS

growing fastest DB research underpins

communication systems Enterprise applications multimedia Internet scientific applications

Page 5: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

5

Data Management Tasks Data Management Tasks

designing the file or database structure entering the data updating data by adding, changing,

or deleting sorting the data searching through the data for a record or

group of records obtaining screen or printed output

Common tasks for flat files and databases are:

Page 6: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

6

Approaches to Data Management include:

Approaches to Data Management include:

Custom Program Approach File Processing System Approach Database Management System

Approach

Page 7: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

7

Contrasting Database and File System Designs

Page 8: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

8

Problems associated with file processing systems

Problems associated with file processing systems

Application/Program dependence

Data is separate and isolated

Data reduplication Multiple formats; hard

to share data across applications.

Page 9: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

9

Database Management Systems

Database Management Systems

OperatingSystem

DatabaseManagement

System

ApplicationPrograms

OperatingSystem

DatabaseManagement

System

ApplicationPrograms

Databases

DataDictionary

DatabaseManagement

Page 10: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

10

Disadvantages of DBMS ApproachDisadvantages of DBMS Approach

Cost Size Complexity Additional Hardware

Requirements Higher Impact of

Failure Recovery more

difficult

Page 11: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

11

Major Types of DatabasesMajor Types of Databases

DatabaseServer

DatabaseServer

ExternalDatabases

End UserWorkstation

OperationalDatabases

AnalyticalDatabases

DataWarehouseDatabases

End UserDatabases

DistributedDatabases

Page 12: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

12

Database Management Systems

Program(s) through which users interact with database

Popular DBMSs include

Access

Oracle

DB2

SQL Server

Premiere Products decides to use Access

Page 13: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

13

DBMS ClassificationsDBMS Classifications Platform

Stand alone Network Mainframe

Organizational Level `Individual Workgroup Enterprise-wide (ex. SAP use of Oracle)

Data Model Supported Hierarchical Network Relational Object-Oriented

Page 14: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

14

Database Models Database Models

Hierarchical Network Relational Object-oriented

details follow

Page 15: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

15

Logical Data ElementsLogical Data ElementsPersonnelDatabase

EmployeeRecord 2

EmployeeRecord 1

EmployeeRecord 3

EmployeeRecord 4

Name SS Salary Name SS Salary Name SS Salary Name SS Salary

Data Data Data Data Data Data Data Data Data Data Data Data

PayrollFile

BenefitsFile

Page 16: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

16

Database StructuresDatabase Structures

Dept

A

B

C

Empno Dept

1 A

2 B

3 C

Relational Structure

Network StructureHierarchical Structure

Page 17: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

17

Premiere Products

Distributor of appliances, house wares, and sporting goods

Uses spreadsheet software to maintain important data

Recent growth has made spreadsheet approach problematic

Page 18: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

18

Figure 1.1: Sample Orders Spreadsheet

Page 19: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

19

Problems Using Spreadsheet

Redundancy

Duplication of data or the storing of the same data in more than one place

Occurs when the same information is stored in more than one place

Difficulty accessing data

Limited security

Size limitations

Page 20: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

20

Premiere Products Required Information

Sales Reps

Sales rep number, last name, first name, address, total commission, commission rate

Customers

Customer number, name, address, current balance, credit limit, customer sales rep

Parts Inventory

Part number, description, number units on hand, item class, warehouse number, unit price

Page 21: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

21

Figure 1.2: Premiere Products Sample Order

Page 22: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

22

Premiere Products Customer Order Order

Order number, order date, customer number

Order line

Order number, part number, number units ordered, unit price

Overall order total

Not stored since it can be calculated

Page 23: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

23

Database Background Database

Structure that can store information about

Multiple types of entities

Attributes of those entities

Relationships among entities

Entity

Person, place, thing, or event

Premiere Products has sales reps, customers, orders, and parts

Page 24: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

24

Database Background (con’t)

Attribute

Property of an entity

Customer has name, street, city, et cetera

May also be called a field or column

Page 25: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

25

Figure 1.3: Entities and Attributes

Page 26: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

26

Database Background (con’t.) Relationship

Association between entities

One-to-many relationship - rep is related to many customers

Customer is related to a single rep

Data file

File used to store data

Computer counterpart to ordinary paper file

Page 27: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

27

Figure 1.4: One-to-Many Relationship

Page 28: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

28

Figure 1.5: Rep and Customer Tables

Page 29: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

29

Figure 1.5: Orders and OrderLine Tables (con’t.)

Page 30: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

30

Figure 1.5: Part Table (con’t.)

Page 31: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

31

Figure 1.6: Alternative Orders Table

Page 32: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

32

Entity-relationship Diagram

Visual way to represent a database

Rectangles represent entities

Lines represent relationships between connected entities

Page 33: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

33

Figure 1.7: E-R Diagram

Page 34: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

34

Figure 1.8 and 1.9: Using DBMSs in Different Ways

Page 35: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

35

Building a Database

Database design determines the structure of a database

Design entered into DBMS during construction Tables – stores data

Forms – screen objects used to maintain, view, and print from a database

Reports – provides formatted output

Switchboards – a set of special forms used to provide controlled access to the data, forms, report and other objects in a database

Page 36: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

36

Figures 1.10 and 1.11: Part and Order Forms

Page 37: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

37

Figure 1.12: Parts Report

Page 38: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

38

Figure 1.13: Main Switchboard

Page 39: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

39

Figure 1.14: Main Data Switchboard

Page 40: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

40

Figure 1.15: Advantages of Database Processing

Page 41: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

41

Figure 1.16: Disadvantages of Database Processing

Page 42: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

42

Introduction to Henry Books Database Case

Book store chain operated by Ray Henry

Henry decided to use database to gather and store information on:

Branches

Publishers

Authors

Books

Page 43: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

43

Figure 1.17: Sample Branch Data

Page 44: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

44

Figure 1.17: Sample Publisher Data (con’t.)

Page 45: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

45

Figure 1.18: Sample Author Data

Page 46: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

46

Figure 1.19: Sample Book Data

Page 47: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

47

Figure 1.20: Wrote Table Relates Authors to Books

Page 48: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

48

Figure 1.20: Inventory Table Relates Branches to Books (con’t.)

Page 49: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

49

Summary Nondatabase approaches to management have

problems with replication, redundancy, sharing, limited security, and size limitations

Entity - a person, place, object, event, or idea for which you want to store and process data

Attribute, field, or column - a characteristic or property of an entity

Relationship - an association between entities

Page 50: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

50

Summary One-to-many relationship - exists when

Each occurrence of the first entity is related to many occurrences of the second entity

Each occurrence of the second entity is related to only one occurrence of the first entity

Database is a structure that can store information about multiple types of entities

An entity-relationship (E-R) diagram represents a database pictorially

Database management system (DBMS) - a program, or a collection of programs, through which users interact with a database

Page 51: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

51

Summary Advantages to database processing:

Getting more information from the same amount of data

Sharing data Balancing conflicting requirements Controlling redundancy Facilitating consistency Improving integrity Expanding security Increasing productivity Providing data independence

Page 52: Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.

52

Summary Disadvantages of database processing:

Larger file size

Increased complexity

Greater impact of failure

More difficult recovery