Transcript
Page 1: INFSY540 Information Resources in Management

INFSY540INFSY540Information Resources in ManagementInformation Resources in Management

Lesson 6

Chapter 5

Database Management

Page 2: INFSY540 Information Resources in Management

Slide 2

Portfolio and Ecommerce Portfolio and Ecommerce HTML AssignmentHTML Assignment

Assignment is on course web space at http://www.courses.psu.edu/infsy/infsy540/rak13/HTML_Portfolio.html

Part of the assignment is to do research on ecommerce.

The first version of your portfolio.html page and subsequent sections of your site must be posted by the October 31st class. The final site must be online by November 28. – There are individual and team activities that need to take

place between these times.

Page 3: INFSY540 Information Resources in Management

Slide 3

Case 2: Cisco Systems ArchitectureCase 2: Cisco Systems Architecture

What’s this case about?When did Cisco go public?What does Cisco stand for?What is Cisco’s mission?

IT Interaction Modelhttp://equity.stern.nyu.edu/~msilver/mbacore/itimhdo.htm

Page 4: INFSY540 Information Resources in Management

Slide 4

Learning ObjectivesLearning Objectives

Know the difference between a database and a spreadsheet.

Identify the objects available in a relational database and their purpose.

Know the difference between a query and a filter.

Identify typical problems that occur with MS Access and other “personal” vice “enterprise” databases.

Page 5: INFSY540 Information Resources in Management

Slide 5

Shared DataShared Data

Poorly organized data prevents sharing that data with other “databases”

Think of all the “databases” that lists your name, department, etc.:

• Messiah College Phone List Database• Students Using College Networked Computers• Students Using Dining Facility• Students Using Nursing Facility

Page 6: INFSY540 Information Resources in Management

Slide 6

Database Management SystemDatabase Management System

Computer program designed to help a user store and retrieve data– Access, Oracle, DB2

Page 7: INFSY540 Information Resources in Management

Slide 7

abcd 1234defg 12asd 123kghb 112

abcd 1234defg 12asd 123kghb 112

abcd 1234 123asd 123 12kghb 112 34

DBMSDBMS

abcd 1234defg 12asd 123kghb 112

tables

forms

query

abcd 1234defg 12asd 123kghb 112

abcd 1234 123asd 123 12kghb 112 34

reports

labelsData

Dictionary

Outside Applications

DBMSEngine

attached

import

Page 8: INFSY540 Information Resources in Management

The Traditional versus the Database The Traditional versus the Database Approach to Data ManagementApproach to Data Management

Page 9: INFSY540 Information Resources in Management

Slide 9

Fig 5.3Fig 5.3

Page 10: INFSY540 Information Resources in Management

Slide 10

Problems with the “Traditional” Problems with the “Traditional” ApproachApproach

Data redundancy Program-data dependence Inflexibility

Page 11: INFSY540 Information Resources in Management

Slide 11

Fig 5.4Fig 5.4

Page 12: INFSY540 Information Resources in Management

Data Modeling & Database ModelsData Modeling & Database Models

Page 13: INFSY540 Information Resources in Management

Slide 13

Data Design IssuesData Design Issues

Content: What data should be collected? Access: What data should be given to what

users? Logical structure: How will the data be

organized to make sense to a particular user? Physical organization: Where will the data

actually be located?

Page 14: INFSY540 Information Resources in Management

Slide 14

Data ModelingData Modeling

Logical designPhysical designPlanned data redundancyData model

Page 15: INFSY540 Information Resources in Management

Slide 15

Data ModelsData Models

Hierarchical modelsNetwork modelsRelational models

Page 16: INFSY540 Information Resources in Management

Slide 16

Fig 5.6Fig 5.6

Page 17: INFSY540 Information Resources in Management

Slide 17

Fig 5.7Fig 5.7

Page 18: INFSY540 Information Resources in Management

Slide 18

Fig 5.8Fig 5.8

Page 19: INFSY540 Information Resources in Management

Slide 19

OperationsOperations

Select rowsProject columnsJoin tables

Page 20: INFSY540 Information Resources in Management

Slide 20

Fig 5.9Fig 5.9

Page 21: INFSY540 Information Resources in Management

Slide 21

Object-Relational Database Object-Relational Database Management SystemsManagement SystemsStores objectsHypertextHypermediaSpatial data technology

Page 22: INFSY540 Information Resources in Management

Slide 22

Database Management Systems Database Management Systems (DBMSs)(DBMSs)

Provide a user viewProvide tools to create & modify the

databaseStore & retrieve dataManipulate dataProduce reports

Page 23: INFSY540 Information Resources in Management

Slide 23

Selecting a DBMSSelecting a DBMS

Number of concurrent users Database sizePerformanceIntegrationFeaturesVendorCost

Page 24: INFSY540 Information Resources in Management

Slide 24

Database DevelopmentsDatabase Developments

Data warehousesData martsData miningOnline analytical processing (OLAP)

Page 25: INFSY540 Information Resources in Management

Slide 26

What Is a Database?What Is a Database?

Database: a collection of dataTable: the primary element for collecting

data, organized into rows and columnsRecord: an individual entry in a table (row)Field: a piece of data in a record (column)

Page 26: INFSY540 Information Resources in Management

Slide 27

Access97: A Database ExampleAccess97: A Database Example

Field (column)

Record(row)

Table

Page 27: INFSY540 Information Resources in Management

Slide 29

Access Database ObjectsAccess Database Objects

Table: Used to store and manipulate data.Query: Used to retrieve information.Form: Used to view one record of data.Report: Used to present, calculate,

summarize, and print table data.Macro/Module: Used to automate

frequently performed procedures.

Page 28: INFSY540 Information Resources in Management

Slide 30

The database window is the command center; it provides the means to create, view, and edit database objects, such as tables, forms, and reports.

Controlicon

Objecttabs Processing or

Command Buttons

Page 29: INFSY540 Information Resources in Management

Slide 31

What is the difference between a database and a spreadsheet?

Page 30: INFSY540 Information Resources in Management

Slide 32

Cost Per Month

Videos Music CDs TotalSusie 42 25 67Jacob 38 36 74Total 80 61 141

Use Microsoft Excel to analyze financial and statistical data.

Excel Spreadsheet

Page 31: INFSY540 Information Resources in Management

Slide 33

Use Microsoft Access to create, maintain, and summarize very large quantities of data.

Access Database

Page 32: INFSY540 Information Resources in Management

Slide 34

Why do “databases” in spreadsheets?Why do “databases” in spreadsheets?

Because we canWe use 1 or 2 massive tables

– “Lots of tables make the database complex”– Discomfort with databases and multiple tables

Because we “think it’s simple”– Skip organizing the data into relational tables– Go straight to designing forms

NAME POSITION SPOUSE CHILDREN PHONE

Jones Chief Gloria, Karen 3274

Smith Clerk Betty 3241

Jones Chief Mary Glorai, Karen 3296

Page 33: INFSY540 Information Resources in Management

Slide 35

Data Redundancy ProblemsData Redundancy ProblemsRedundancy breeds errors

– Same data defined in multiple places is BAD– Spelling/typographical error prone– Lack of data integrity

Inability to perform simple queriesInflexibility and inscalabilityImpossible to MAINTAIN!

Page 34: INFSY540 Information Resources in Management

Slide 36

Relational DatabaseRelational DatabasePROJECTCHIEFProject Project ChiefComputing 333-22-1111Intranet 987-65-4321Contracting 123-45-6789Jordan 333-22-1111

DEPARTMENTSDept Dept. Director RoomEngr 181-94-5676 B115Math 987-65-4321 123M&B 123-45-6789 147

EMPLOYEESLName FName SSN DeptJones Mike 123-45-6789 M&BSmith Tony 987-65-4321 MathLee Bruce 567-89-1234 EngrrDoodle Yankee 333-22-1111 M&B

1

1

Page 35: INFSY540 Information Resources in Management

Slide 37

ExampleExample

EmployeeSSNL NameF NameRankSpouseChildrenOffice Phone#Home Phone#Office Room#Dept Dept. Chief

EmpProjProject NameEmployee SSN Function

•Must know all constraints on data–project name is unique

–only one chief per project

–employees can have more than one phone#

–employees can have only one office

–many employees can use the same office

Page 36: INFSY540 Information Resources in Management

Slide 38

Just a ReminderJust a Reminder

A table is a single object within a databaseA database can have other objects such as

queries, forms, reports, macros, and programming modules

However, at least one table object must be created before you can create any other type of object

Page 37: INFSY540 Information Resources in Management

Slide 39

Database Design TemplatesDatabase Design Templates

CHOOSE: File, New Database orCLICK: New Database button

DesignTemplates

Page 38: INFSY540 Information Resources in Management

Slide 40

Using Datasheet View (Usually used for entering data into records)

Using the Table Wizard (Usually used for creating tables)

Using Design View (Usually used for creating tables and editing fields)

How Do I Create a Table?How Do I Create a Table?

Sample Table in Datasheet View

Page 39: INFSY540 Information Resources in Management

Slide 41

Using the Table WizardUsing the Table Wizard

Pick fields from existing business and personal table structures

Page 40: INFSY540 Information Resources in Management

Slide 42

Using Design ViewUsing Design View

Specify field names, data types, and indexes from scratch

Define fieldsand data types

Define fieldproperties

Note: Fields are shown in rows in the design view,

not in columns.

Page 41: INFSY540 Information Resources in Management

Slide 43

Field Data TypesField Data Types

Text Memo Number Date/Time Currency

Autonumber Yes/No OLE Object Hyperlink Lookup Wizard

Page 42: INFSY540 Information Resources in Management

Slide 44

Field PropertiesField Properties

Field Size Format Decimal Places Input Mask Caption Default Value

Validation Rule Validation Text Required Allow Zero Length Indexed

Page 43: INFSY540 Information Resources in Management

Slide 45

Primary Keys Primary Keys (Are extremely important in databases.)(Are extremely important in databases.)

Primary key is a field that uniquely identifies each record in a table– Data is automatically displayed in the datasheet sorted

by the primary key.– There are 3 types of primary keys: AutoNumber,

Single-Field, and MultiField.– You can use Access AutoNumber as a primary key

(since it is unique) but it is not a good idea.

CHOOSE: Edit, Primary Key orCLICK: Primary Key button

Page 44: INFSY540 Information Resources in Management

Slide 46

Primary KeysPrimary Keys

A primary key is one or more data fields (columns) that uniquely identify each record in the table

What would the primary key be below?– “table of employees, assigned to a department.”

EMPLOYEESLName FName SSN DeptJones Mike 123-45-6789 MathSmith Tony 987-65-4321 M&BLee Bruce 567-89-1234 Science

Page 45: INFSY540 Information Resources in Management

Slide 47

IndexesIndexes

Like Primary Key, can be used to determine the order in which data is displayed

CLICK: Indexes button

PrimaryKey

IndexDefinition

Indexes can slow down data entry. Access automatically creates indexes for fields with ‘ID’ in their names.

Page 46: INFSY540 Information Resources in Management

Slide 48

Access Uses Automatic Saving Access Uses Automatic Saving

CLICK: a cell using the mouse pointerMake changes to the cell’s information.SELECT: another record to save the

changesCHOOSE: Edit, Undo from the menu

if you want to reverse the most recent changes

Note: This is a very important difference between Access and other Office 2000 products..

Page 47: INFSY540 Information Resources in Management

Slide 49

Customizing Datasheet ViewCustomizing Datasheet View

Remember: formatting changes are not saved automatically. Only structural and data changes are saved automatically.

Page 48: INFSY540 Information Resources in Management

Slide 51

Adjusting Row HeightsAdjusting Row Heights

DRAG: the border between rows to change all row heights in the datasheet

RowBorders

Page 49: INFSY540 Information Resources in Management

Slide 52

Reordering FieldsReordering Fields

SELECT: the entire field columnDRAG: field name to move the column

To save the Datasheet view:CLICK: Save button

Page 50: INFSY540 Information Resources in Management

Slide 53

Sorting RecordsSorting Records

Allows you to better organize and present data; makes information out of raw data (alphabetical phone listing)

SELECT: column or field to sortCLICK: Sort Ascending buttonCLICK: Sort Descending button

Page 51: INFSY540 Information Resources in Management

Slide 54

FiltersFilters

Lets you limit the display of records in a table using a simple matching criterion

Methods for filtering data: Filter For Input Filter By Selection Filter Excluding Selection Filter By Form Advanced Filter/Sort

Page 52: INFSY540 Information Resources in Management

Slide 55

What Is a Query?What Is a Query?

A query is a question you ask of your database– How many customers live in Chicago?– What is the average age of our employees?

There are two types of queries– Select queries let you retrieve information– Action queries let you modify information

Page 53: INFSY540 Information Resources in Management

Slide 56

Queries versus FiltersQueries versus Filters

Although similar to filters, queries provide additional functionality:– you can display data from multiple tables– you can control which fields display– you can perform calculations on field values

While filters are temporary, queries are saved as independent database objects

Page 54: INFSY540 Information Resources in Management

Slide 57

Query Design WindowQuery Design Window

A graphical query-by-example tool.

Displays tableson which you’vechosen to base

your query

Displays the gridthat you use to

specify your criteriaand sorting options

Page 55: INFSY540 Information Resources in Management

Slide 58

Query Grid AreaQuery Grid Area

Field: used to add a field to the gridTable: used to clarify the field’s tableSort: used to sort the resulting tableShow: used to hide or show the fieldCriteria: used to set the query criteriaOr: used to specify a second criterion

Page 56: INFSY540 Information Resources in Management

Slide 59

Specifying a Search CriteriaSpecifying a Search Criteria

Enter an example of value you are searching for in the Criteria row

Use the question mark (?) wildcard to represent a single unknown character

Use the asterisk (*) wildcard to represent more than one character

Use operators (<, >, =) to limit records between a range of values or dates

Page 57: INFSY540 Information Resources in Management

Slide 60

Examples of Search CriteriaExamples of Search Criteria

Like Sm?threturns records with Smyth and Smith

Like Ch*ngreturns records with Chang and Chickering

Between 21 And 65returns records with values from 21 to 65

<=98000returns values of less than or equal to 98000

Page 58: INFSY540 Information Resources in Management

Slide 61

How Do I Create a Form?How Do I Create a Form?

Using the AutoForm WizardUsing Design View

A form created usingthe AutoForm Wizard

Form Navigation Controls

Page 59: INFSY540 Information Resources in Management

Slide 62

What Is a Report?What Is a Report?

An on-screen or printed display of organized data from a table

Examples include: sales summaries, invoices, mailing labels, personal address books, and inventory listings

Report Title

Name Address Phone

Page 60: INFSY540 Information Resources in Management

Slide 63

AutoReport: ColumnarAutoReport: Columnar

Created using the AutoReport Wizard.

FieldNames

TableData

Page 61: INFSY540 Information Resources in Management

Slide 64

AutoReport: TabularAutoReport: Tabular

Created using the AutoReport Wizard.

FieldNames

TableData

Page 62: INFSY540 Information Resources in Management

Slide 65

Questions to consider when Questions to consider when designing a DataBasedesigning a DataBase

Who will use it?What type of tasks?What are the data sources?What output is required?

Page 63: INFSY540 Information Resources in Management

Slide 66

Data ModelingData ModelingDetermine Data RequirementsDetermine Data Requirements

•Entity Class•something that can be identified in environment•each entity class is a separate table•each entity becomes a separate row in a table

•Attributes•property or characteristic of entity•each characteristic of an entity class become a column•each characteristic of an entry become an entry in table

•Keys •one or more attributes that uniquely identified an entity

•Constraints•values or rules the DBMS must enforce

Page 64: INFSY540 Information Resources in Management

Slide 67

Designing a DatabaseDesigning a Database

Determine your output requirementsDesign your database on paper firstDivide information into separate fieldsDivide information into separate tables Identify each record with a unique codePlace important fields at top of structureTest your database

Page 65: INFSY540 Information Resources in Management

Slide 68

Access Lab and AssignmentAccess Lab and Assignment If not familiar with Access, then go to lab and on course

web space do either Access 97 or Access 2000 tutorials.– access_tutorial_2000.html– access_tutorial_97.html

Try doing exercises 1-5 and 20-25 on page 205 and 206 using c05Ex15.mdb and Rolling Thunder Database from student CD (or from G:\Courses\Infsy540).

Database Assignment will be on course web space next week– dbms_assignment.html– Due by beginning of class on Oct 17th

Page 66: INFSY540 Information Resources in Management

Slide 69

Questions?Questions?