introduction to database systems david maier, judy cushing 1 lecture 1 introduction to database...

24
Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David Maier Oregon Graduate Institute of Science & Technology All material © 1992, 1994, 1996, 1999,2000, 2006 David Maier, Judy Cushing

Upload: james-watson

Post on 19-Jan-2016

220 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 1Lecture 1

Introduction to Database Systems

Judy CushingThe Evergreen State College

David MaierOregon Graduate Institute of Science & Technology

All material © 1992, 1994, 1996, 1999,2000, 2006 David Maier, Judy Cushing

Page 2: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 2Lecture 1

Consider

You are a courier for a legal firm.

You drive around to county seats in Washington to get copies of documents.

Naive approach1. get a request2. go get the document3. repeat

How can you do the job faster?1. 2.

3.

Page 3: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 3Lecture 1

Secondary Storage Access

time to read a document

time to drive to a county seat

Performance on disk access—lower costs for each access and reduce I/O

1.

2.

3.

Page 4: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 4Lecture 1

Consider

Two parking garages:Judy's garage: park the cars on different

floorsDave's garage: take cars apart, wheels on

first floor, engines on second floor, windshields in basesment

Who can do the following faster?Remove a car from the garageFind the total weight of the carSee what percentage of tires are Dunlop’sWash all windshieldsSwap engines between two cars

Which garage can hold more cars?

Page 5: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 5Lecture 1

Storage Structures and Access Methods

Databases provide alternative storage formats and access methods for a given data structure.

Allows DB designer or DB administrator to choose differet representations depending on expected uses of data or time-space trade-offs.

Page 6: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 6Lecture 1

ConsiderThe college’s seminar schedule

It's kept in a file on the computer.Following has happened

1. Prof. A wants to schedule a speaker2. Calls up speaker, opens file to edit it3. Prof. B also opens the file to change it4. Prof. A enters speaker and writes files5. Prof. B enters speaker and writes file.

We lost a speaker. How to avoid this?1.

2.

3.

Page 7: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 7Lecture 1

Concurrency Control

Databases control concurrent access to shared data to keep it consistent and not lose changes.

1.

2.

3.

Page 8: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 8Lecture 1

Consider

You have an idea how to modify the rear hub of your bicycle, but it might not work. Need to put it back as it was if the idea doesn't work out.

What can you do?1.

2.

3.

Page 9: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 9Lecture 1

Recovery

Databases provide for database resiliency in the face of failure.

Called recovery management

1.

2.

3.

Page 10: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 10Lecture 1

Consider

You have a group of 8 people looking at different laser printers, and each doing a report on features and costs.

You have to put together a document combining the reports, and want it to look nice.

You could re-edit everyones report to a consistent style, or

1.

2.

Page 11: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 11Lecture 1

Database Schema

A database provides a schema that explicitly describes allowed data format separate from the data itself and the applications that use it.

In contrast to:

Page 12: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 12Lecture 1

Consider

You are supposed to proofread an airlines assignment of crew and aircraft to flights.

What kinds of things do you check?

1.

2.

3.

4.

5.

Page 13: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 13Lecture 1

Integrity Constraints

Database systems support enforcement of certain kinds of integrity constraints on the data.

1.

2.

Page 14: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 14Lecture 1

Consider

You have a video store.

Customers like to browse movies by category. But you also get requests for movies by name.

How do you arrange your store?

1.

2.

3.

Page 15: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 15Lecture 1

Auxiliary Access Structures

Database systems provide auxiliary access structures to get to data along dimensions other than physical order.

1.

2.

Page 16: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 16Lecture 1

Consider

You are laying out the weekly TV program guide for a local newspaper.

There are several cable companies in the area, and they don't have stations on the same channels.

You could list all channels for a program next to it, but that is hard to read and uses a lot of space. What are alternatives?

1.

2.

Page 17: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 17Lecture 1

Normalization

Database design involves normalization of database schemes to reduce redundancy and avoid update anomalies.

I recently got married, changed my name, moved and changed my address....

Page 18: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 18Lecture 1

Consider

Your boss gives you a stack of 10,000 invoices from the past month.

There's a file cabinet with 500 customer files, organized by name.

You are supposed to check each invoice against the customer files, and put a hold on the invoice if the account is more than 60 days past due.

What's a good strategy here?

Page 19: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 19Lecture 1

Query Processing

Databases provide query languages for formulating data requests, and query processors that choose a plan for execution based on

1.

2.

Page 20: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 20Lecture 1

Consider

You have arranged a restaurant dinner for 6 people for 7pm.

One person calls up and wants to move it to 8pm.

How do you proceed so that everybody believes it is at 7pm or everyone believes 8pm?

(You might not be able to reach everyone, or some people may not be able to change.)

Page 21: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 21Lecture 1

Data Distribution

Some database systems provide support for distributed data across sites, and keeping replicated copies of data consistent.

2-Phase Commit1.

2.

3.

4.

Page 22: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 22Lecture 1

Other Database Features

Authorization and SecurityDatabase Administration

• adding/removing users• archiving, backup• accounting, usage monitoring

Application Development Tools

Device and Physical Data Independence

Views and Derived Data

Page 23: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 23Lecture 1

Study QuestionsWhat kinds of information does a database hide?

What are the disadvantages of using a database system?

What aspects of data semantics do E-R diagrams fail to capture?

Why distinguish entities, attributes and relationships?

Can entity instances be distinguished apart from the values of their attributes?

Can you tell two entities apart if their attribute values are all the same?

Page 24: Introduction to Database Systems David Maier, Judy Cushing 1 Lecture 1 Introduction to Database Systems Judy Cushing The Evergreen State College David

Introduction to Database Systems

David Maier, Judy Cushing 24Lecture 1

Concepts from A97, Lessons 1-3

Data, database, form, table, fields.

Option group, record selector, field selector, value, list box, combo box.

Command button, macro, validation, filter, criteria, view, query, report.