Top Banner
Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07
56

Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

Dec 19, 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: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

Introduction to Management Information

Systems

Chapter 4 Database Processing

HTM 304

Fall 07

Page 2: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

2

Learning Objectives

Know purpose of database processing

List components of a database system

Understand important database terms

Know elements of the entity-

relationship model

Understand general nature of

database design

Page 3: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

3

Purpose of a Database

Keep track of things

with more than one theme

Page 4: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

4

One Theme Spread Sheet

Page 5: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

5

Multi-theme Database

Student Score

Student Score

Email records

Email records

officevisits

officevisits

All three records for one student(student is the link of different themes)

All three records for one student(student is the link of different themes)

Page 6: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

6

Database Hierarchy

Bytes: the basic elements which compose of database

Fields (Columns). Name, number or characters that describe an

aspect of a business object or activity.

e.g. Student Numbers, Student Names, Midterm Scores, etc.

Record (Rows). Collection of related data fields.

e.g. 000054323 Jenny White 89.

File (or Table). Collection of related records.

e.g. Student Score Table, Student Office Visit Table, Student Email

Record Table

Database. Collection of integrated and related files + Relations

between (among) tables + structure of data.

The relations and structures are called metadata

Page 7: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

7

Components of Database

Database

Tables or Files

+

Relationships among Rows in Table

+

Metadata

=

How to effectively organize and process raw data is the key to a successful database design and an Information System design.

Page 8: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

8

Student Table

Records/Rows

Columns/Fields

Page 9: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

9

Poorly Designed Table

In Database Design, the record will be split into 2 records:Jones Feb 1, 2002 [email protected] 100 FinanceJones Feb 1, 2002 [email protected] 100 Accounting

In Database Design, the record will be split into 2 records:Jones Feb 1, 2002 [email protected] 100 FinanceJones Feb 1, 2002 [email protected] 100 Accounting

Common Practice in ExcelCommon Practice in Excel

Pros and cons?

Page 10: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

10

Relationships

The records in different tables are connected by certain relationships – relational databases

Key – column or group of columns that identifies a unique row in a table

For example: Student Number is key of Student table

The key insures no repeated records

Every table MUST have a key

Foreign key – non-key column or field in one table that links to a primary key in another table

Student Number in Email and Office_Visit tables

Foreign keys link records from different tables together as one compound record

Page 11: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

11

Examples of Relationships

Key

Foreign Key

Foreign Key

Page 12: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

12

Review Components

Database

Tables or Files

+

Relationships among Rows

+

Metadata

=

Page 13: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

13

Metadata

Metadata are data that describe data (Format, Field Properties, etc.)

Makes databases much more useful

No one needs to guess, remember, or record what is in database

Make databases easy to use for authorized and unauthorized purposes

Page 14: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

14

Exercise: Use Access to setup a data table

Create a database file (*.mdb)

Create table in design view

All tables are in one database file

First create the table in design view

Specify the fields (column headers)

Specify the types of the fields, and other properties

Specify which field is the key!

Finish design view -- Close the design view

Fill in records in the table

Double click the table to enter editing view

Enter records

Try enter repeated keys, it won’t let you! Why?

Page 15: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

15

DB Application Systems Components

Pure database data correct,

but raw form not pertinent

or useful

DB applications make DB data

accessible and useful

Users employ DB applications

Forms

Formatted reports

Queries (SQL language)

Application programs

Each calls on DBMS to

process DB tables

Page 16: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

16

DB Application System Components

DBMS (Database Management System)A program used to create, process, and administer a database. Database developers use the DBMS to create tables, relationships, and otherstructures in the database.

DBMS (Database Management System)A program used to create, process, and administer a database. Database developers use the DBMS to create tables, relationships, and otherstructures in the database.

Page 17: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

17

Enterprise DBMS

Process large organizational and workgroup databases

Support many, perhaps thousands, of users and many different

database applications

Support 24/7 operations and can manage dozens of different

magnetic disks with hundreds of gigabytes or more data

IBM’s DB2, Microsoft’s SQL Server, and Oracle are examples of

enterprise DBMS products

Page 18: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

18

Personal DBMS

Designed for smaller, simpler database applications.

Used for personal or small workgroup applications that

involve <100 users, normally fewer than 15

Bulk of personal databases have only a single user

Microsoft Access only available personal DBMS

Page 19: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

19

Language used in DBMS

SQL: Structured Query Language An international standard language for processing a database: Data Manipulation/Definition and Data Queries

Data Manipulation

Data Queries: See later.

INSERT INTO StudentTable ([Student Number], [Student

Name], Hw1, Hw2, MidTerm) VALUES (1000, ‘Joe Black’, 90,

85, 88)

DELETE FROM StudentTable WHERE MidTerm = NULL

UPDATE StudentTable SET MidTerm = ’90’ WHERE Student

Number = ‘1000’

Page 20: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

20

Exercise:

Below shows the original table.

Write down the resulting table after executing the following SQL command:

UPDATE StudentTable SET LetterScore = ’A’ WHERE Score >= ‘90’.

Original Table: StudentTable

StudentNumber StudentName Score LetterScore

1000 Justin Frank 89 --

2000 Dennis Wilson 60 --

3000 Sheldon Benson 92 --

4000 Gordon Black 87 --

5000 Jimmy Foxx 96 --

Exercise: write down all the other letter scores based on certain criterion.

Page 21: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

21

DB Application System Components

DBMS (Database Management System)A program used to create, process, and administer a database. Database developers use the DBMS to create tables, relationships, and otherstructures in the database.

DBMS (Database Management System)A program used to create, process, and administer a database. Database developers use the DBMS to create tables, relationships, and otherstructures in the database.

Database Applications: collection of forms, reports, queries, and application programs that process a database.A database may have one or more applications, and each app. may have one ore more users…(Page 84)

Database Applications: collection of forms, reports, queries, and application programs that process a database.A database may have one or more applications, and each app. may have one ore more users…(Page 84)

D B M S

Page 22: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

22

Multiple Database Applications

Think how the school uses student information?

Page 23: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

23

Form – A structured way to edit and view data

Page 24: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

24

Example Student Report

Read Only. No Editing

Page 25: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

25

Query

Use SQL to search through the database and produce certain results.

SELECT (certain attributes) FROM (certain database tables)

WHERE (conditions)

SELECT STUDENT Name, MIDTERM

FROM STUDENTTABLE

WHERE MIDTERM>90

Page 26: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

26

Exercise:

Write down the results when using the following query command on the following original data table:

SELECT MIDTERM FROM STUDENTTABLE WHERE MIDTERM>90

SELECT Student Name FROM STUDENTTABLE WHERE MIDTERM<70

SELECT Student Name, Student Number, HW1, HW2, MidTerm FROM

STUDENTTABLE WHERE MidTerm > (HW1+HW2)/2

Page 27: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

27

DB Application System Components

Page 28: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

28

Database Development Process

E-R Modeling: High level blueprint defining how data are stored structurally in the system

Define users’ need through interview

Page 29: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

29

E-R Modeling

E-R Model: a detailed, logical representation of the data for a business. To document rules and policies of an organization that govern data.

Page 30: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

30

Components in E-R Model

Entity – something users want to trackExamples Order, Customer, Salesperson, Item

Some entities represent physical object, such as an Item or Salesperson

Other entities represent a logical construct of transaction, such as Order or Contact

Entities have attributes that describe characteristics of the entity

Example attributes of Salesperson are SalespersonName, Email, Phone, etc.

Page 31: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

31

Entities (cont)

Entities have identifier, an attribute

(or group of attributes) whose value is

associated with 1 & only 1 entity instance

OrderNumber is the identifier of Order, because only 1

Order instance has given value of OrderNumber

CustomerNumber identifier of Customer

If each member of sales staff has unique

name, then SalespersonName is an

identifier of Salesperson

Page 32: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

32

Student Data Model Entities

Page 33: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

33

Relationships

Connects identities, allow cross entity search

A line is used to represent a relationship between two entities

Page 34: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

34

Three basic types of relationships

One-to-one:

One student can buy only one permit

One permit can only

purchased by one student

One-to-Many:

One instructor can teach many courses

A course can only be taught by one instructor

Crow’s foot = Many

Many-to-Many:

One student can take more than one course

A course can be registered by multiple students

Parking Permit #Date of PurchaseType of PermitExpiration Date…

Student IDNameDoBAddress…

Student Parking permit

CRNCourse TitleClassroomCredit…

Instructor IDNameDepartmentOffice…

instructor Course

CRNCourse TitleClassroomCredit…

Student IDNameDoBAddress…

Student Course

Page 35: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

35

Exercise

Who defines the relationships?

Page 36: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

36

Exercise:

Exercise 22 a) (Page 105)

Page 37: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

37

Opposing Forces Guide:

No, Thanks, I’ll Use a SpreadsheetI’m not buying all this stuff about databases.

“I’ve tried them and they’re a pain-way too complicated to set up, and most of the time, a spreadsheet works just as well.”

“No, unless you are a General Motors or Toyota, I wouldn’t mess with a database.”

“You have to have professional IS people to create it and keep it running.”

“Besides, I don’t really want to share my data with anyone.”

“I work pretty hard to develop my client list.”

“Why would I want to give it away?”

“When I want something, I use Excel’s Data Filter.”

“I can usually get what I need.”

“Of course, I can’t still send form letters, but it really doesn’t matter.”

“I get most of my sales using the phone, anyway.”

Page 38: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

38

Database Security

The firewall, a computing device located

between a firm’s internal network and

external networks, prevents

unauthorized access to the internal

network.

For the best security, the DBMS

computer should be protected by a

firewall, and then all other security

measures should be designed as if the

firewall has been breached.

Page 39: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

39

Database Security (cont)

All operating systems and DBMS patches should be installed as soon as they become available.

No one other than authorized operations personnel should be able to directly access the computer that runs the DBMS.

The computer running the DBMS should be secured behind locked doors, and visits to that room should be recorded in a log.

Most DBMS products log failed attempts to sign on and

produce other usage reports as well.

The database administrator (DBA) should periodically

monitor such logs and reports for suspicious activity.

Page 40: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

40

Database Security (cont)

All major DBMS products have extensive, built-in security features.

These features allow for the definition of user accounts and user roles.

Each user account belongs to a specific person.

A role is a generic employee function, such as payroll clerk or field salesperson.

Once an account is defined, it can be assigned specific permissions, and it can also be assigned particular roles.

It is important to have a plan of action for security emergencies.

Disaster Recovery Plan (85%)

Business Continuity Plan (<15%)

The steps to be taken vary from database to database.

Page 41: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

41

Ethic Guide: Nobody Said I Shouldn’t

Kelly make a backup copy of his company’s

database on CD and took it home and installed it

on his home computer.

While performing queries on the database, he

found customer order information and focused in

on his friend Jason’s customer order entries.

Kelly noticed that Jason gave huge discounts to

Valley Appliances but not to his other customers.

At an after work gathering, Kelly asked Jason about the Valley

Appliances discount telling him what he had been doing.

When Kelly returned to work, he was fired

Page 42: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

42

Class 2: E-R Modeling and Database Lab

E-R Data ModelThe most popular technique for creating a data model.

E: entity (things)

R: relationship (among the entities)

+ business rules restricting the flow of the data

Data Model:Read Problem Solving Guide: (p89a)

Immanuel Kant, Data Modeler

Attempts to model the “real world”

Simply a model of what the data modeler perceives

Page 43: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

43

5 minutes free write

Social Implications of DB:

Relate any of Kant’s ideas to what you

learned from reading “For Some, Online

Persona Undermines Resume”

PRINT your name on Free Write and hand it

in

Page 44: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

44

More exercise

Book 23 a) Create a E-R Diagram to relate all the information in the form

Page 45: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

45

Translating E-R diagram into Tables (1:N)

Step 1: Create one table for each entity

Key

Key

Page 46: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

46

Translating E-R diagram into Tables (1:N)

Step 2: Add Foreign Key Column to the “many entity” to represent relationship

Page 47: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

47

Step 3: edit relationship

Go to Tools RelationshipsAdd two entities

Drag the “advisor name” of advisor table to the “advisor name” of student table.

Close relationships

Page 48: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

48

Many-to-Many Relationship

Now the rule changedOne advisor can supervise many students

One student can have many adviser

One student must have at least one advisor

One advisor can have no student

Page 49: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

49

Foreign Key doesn’t work for N:M relationship

Page 50: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

50

Solution

Page 51: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

51

Exercise:

Revise the relationship of previous exercise in Access and input the above records

Page 52: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

52

1:1 Relationship

How to convert into tables?

Page 53: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

53

Exercise

Based on your E-R diagram in 23(a), construct tables and relationships in Access. Add at least three records for each table.

Page 54: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

54

Importance of User Review

Users are the final judges of what data the database

should contain and how records relate to one another

Easiest time to change database structure is during data

modeling stage

Once database has been constructed, loaded with data,

and application forms, reports, queries, and application

programs created, changing a relationship means weeks

of work!

Page 55: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

55

How should you review as a user? (Cont)

When database developed for your use, you must carefully review

data model

If you don’t understand any aspect of it, ask for clarification until

you do

Data model must accurately reflect your view of business

Do not proceed unless you are 100% comfortable with the model

Page 56: Introduction to Management Information Systems Chapter 4 Database Processing HTM 304 Fall 07.

57

Key Terms and Concepts (Cont.)

Access Field many-to-many relationship

Attribute File (Table) Oracle

Byte Foreign key Query

Column Identifier Personal DBMS

Crow’s foot Key Record

Database Maximum cardinality Relationship

Database application system Meta Data Report

DBMS Minimum cardinality Row

E-R data model one-to-many relationship SQL Server