20
Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Spreadsheets and Databases Class 8 LBSC 690 Information Technology

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Spreadsheets andDatabases

Class 8

LBSC 690

Information Technology

Page 2: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Agenda

• Questions

• Spreadsheets

• Database design

Page 3: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

What’s a Spreadsheet?

• Large table containing numbers– May also contain labels to aid interpretation– Columns are named with LETTERS– Rows are named with NUMBERS– Cells are named like A4, C1, ...

• Some cells are automatically calculated– Formula specified when spreadsheet is created– Values are recalculated continuously

Page 4: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

How Spreadsheets are Used

• Record keeping (cassette tapes)

• Calculation (income tax)

• What-if analysis (cash flow)– Sensitivity analysis (exchange rate)

• Goal seeking (retirement planning)– Uses continuous recalculation (“iteration”)

Page 5: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

How Spreadsheets are Used

• Record keeping (cassette tapes)

• Calculation (income tax)

• What-if analysis (cash flow)– Sensitivity analysis (exchange rate)

• Goal seeking (retirement planning)– Uses continuous recalculation (“iteration”)

Page 6: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Spreadsheet Applications

• Originally designed for financial records

• Library applications– Budget– Collection development– Shelving capacity

• Educational Applications– Grade records– Equipment inventory

Page 7: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Excel Demo

• Start Excel– Microsoft Office folder

• Open N:\SHARE\CLASS\POSTCARD.XLS– File menu

• Enter your 1997 (desired) income in cell B3– Tax due is displayed in cell B4

Page 8: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Excel Demo• Change the tax due

– Place the cursor over B4– Type “=B3*0.x”

• “=” tells Excel this is a formula

• “B3” refers to the number in cell B3

• The “x” in “0.x” should reflect your political views– 0.5 would take away half your money

– Try different values in cell C3

• What kind of spreadsheet use is this?

Page 9: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Excel Demo

• Add itemized deductions– Highlight row 4 (click on 4)– Select “Row” in “Insert” menu twice– Label A4 as “Deduction amount”– Label A5 as “Taxable income”– Put the appropriate formula in B5– Change the formula in B6 as needed

• Note how it was copied from B4 with changes

Page 10: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Excel Demo

• Limit the deduction– Maximum of 50% of income or 10,000

• Search for help on “maximum”

• Replace the formula in B5 with a more complicated one– You can use another cell to show a partial result

Page 11: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

When Style is Important• Too complex to visualize at once

– Size– Relationships between formulas

• Used by more than one person– Includes use in presentations and papers

• Used for a long time– Essentially communicating to yourself

Page 12: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Style Guidelines

• Organization– Depict the solution approach visually– Group things where possible (e.g., parameters)– Build in cross-checks to discover input errors

• Readability– Describe the computation– Meaningful labels help a lot– Minimize clutter

Page 13: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Building Complex Applications

• Computers keep track of detail well– But people don’t

• Adopt meaningful abstractions– Organize a calculation the way you think

• Use a structured process– Examples: waterfall and spiral models

Page 14: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Relational Databases

• Tables represent relations– Name, project– Name, email address, phone number

• Relations can be “joined”– Name, project, email address, phone number

• Relations can be “projected”– Name, email address

• Relations can be “restricted”– Name = “Doug Oard”

Page 15: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Why use Join?

• Forces consistency– Doug Oard, project 18, oard@glue, 57590– Doug Oard, project 22, oard@wam, 57590

• Limits the chance of error– Doug Oard, project 18, oard@glue, 57590– Doug Oard, project 19, oard@glue, 57490

• Avoids lots of duplicated entry and updates

• Can save a lot of storage space

Page 16: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Problems with Joins

• Data modeling for joins is complex– Taught in LBSC 670

• Joins are expensive to compute– Both in time and storage space

• But it is joins that make databases relational– Projection and restriction also used in flat files

Page 17: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Key Fields

• Primary Key uniquely identifies line to join– May group several fields to get a unique key

• Social security number

• First and last name

• “Foreign” key must appear in the other table– But it need not be unique there

• Join makes a new table– Line specified by foreign key is tacked on

Page 18: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Example of a Join on “Team”

Name Team Team Project Name Team Project

Chris

Chris

Camile

Eileen

Natalie

David

Tonya

Michelle

Skip

A

A

A

B

C

B

C

C

A

B

C

Database

Web

Web

A

A

A

B

C

B

C

C

Chris

Chris

Camile

Eileen

Natalie

David

Tonya

Michelle

Skip

Database

Web

Web

Web

Web

Web

Database

Database

Page 19: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Project to Keep Two FieldsName Team Team Project Name Project

Chris

Chris

Camile

Eileen

Natalie

David

Tonya

Michelle

Skip

A

A

A

B

C

B

C

C

A

B

C

Database

Web

Web

Chris

Chris

Camile

Eileen

Natalie

David

Tonya

Michelle

Skip

Database

Web

Web

Web

Web

Web

Database

Database

Page 20: Spreadsheets and Databases Class 8 LBSC 690 Information Technology

Restrict to Web Pages

Name Team Team Project Name Project

Eileen

Natalie

David

Tonya

Skip

A

A

A

B

C

B

C

C

A

B

C

Database

Web

Web

Chris

Chris

Camile

Eileen

Natalie

David

Tonya

Michelle

Skip

Web

Web

Web

Web

Web