Introduction to Database Systems

Download Report

Transcript Introduction to Database Systems

Introduction to Database Systems
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
Lecture 1
David Maier, Judy Cushing
1
Introduction to Database Systems
Consider
You are a courier for a legal firm.
You drive around to county seats in Washington to get
copies of documents.
Naive approach
1. get a request
2. go get the document
3. repeat
How can you do the job faster?
1.
2.
3.
Lecture 1
David Maier, Judy Cushing
2
Introduction to Database Systems
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.
Lecture 1
David Maier, Judy Cushing
3
Introduction to Database Systems
Consider
Two parking garages:
Judy's garage: park the cars on different floors
Dave'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 garage
Find the total weight of the car
See what percentage of tires are Dunlop’s
Wash all windshields
Swap engines between two cars
Which garage can hold more cars?
Lecture 1
David Maier, Judy Cushing
4
Introduction to Database Systems
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 timespace trade-offs.
Lecture 1
David Maier, Judy Cushing
5
Introduction to Database Systems
Consider
The college’s seminar schedule
It's kept in a file on the computer.
Following has happened
1. Prof. A wants to schedule a speaker
2. Calls up speaker, opens file to edit it
3. Prof. B also opens the file to change it
4. Prof. A enters speaker and writes files
5. Prof. B enters speaker and writes file.
We lost a speaker. How to avoid this?
1.
2.
3.
Lecture 1
David Maier, Judy Cushing
6
Introduction to Database Systems
Concurrency Control
Databases control concurrent access to
shared data to keep it consistent and
not lose changes.
1.
2.
3.
Lecture 1
David Maier, Judy Cushing
7
Introduction to Database Systems
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.
Lecture 1
David Maier, Judy Cushing
8
Introduction to Database Systems
Recovery
Databases provide for database resiliency
in the face of failure.
Called recovery management
1.
2.
3.
Lecture 1
David Maier, Judy Cushing
9
Introduction to Database Systems
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.
Lecture 1
David Maier, Judy Cushing
10
Introduction to Database Systems
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:
Lecture 1
David Maier, Judy Cushing
11
Introduction to Database Systems
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.
Lecture 1
David Maier, Judy Cushing
12
Introduction to Database Systems
Integrity Constraints
Database systems support enforcement
of certain kinds of integrity constraints
on the data.
1.
2.
Lecture 1
David Maier, Judy Cushing
13
Introduction to Database Systems
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.
Lecture 1
David Maier, Judy Cushing
14
Introduction to Database Systems
Auxiliary Access Structures
Database systems provide auxiliary access
structures to get to data along
dimensions other than physical order.
1.
2.
Lecture 1
David Maier, Judy Cushing
15
Introduction to Database Systems
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.
Lecture 1
David Maier, Judy Cushing
16
Introduction to Database Systems
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....
Lecture 1
David Maier, Judy Cushing
17
Introduction to Database Systems
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?
Lecture 1
David Maier, Judy Cushing
18
Introduction to Database Systems
Query Processing
Databases provide query languages for
formulating data requests, and query
processors that choose a plan for
execution based on
1.
2.
Lecture 1
David Maier, Judy Cushing
19
Introduction to Database Systems
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.)
Lecture 1
David Maier, Judy Cushing
20
Introduction to Database Systems
Data Distribution
Some database systems provide support
for distributed data across sites, and
keeping replicated copies of data
consistent.
2-Phase Commit
1.
2.
3.
4.
Lecture 1
David Maier, Judy Cushing
21
Introduction to Database Systems
Other Database Features
Authorization and Security
Database Administration
• adding/removing users
• archiving, backup
• accounting, usage monitoring
Application Development Tools
Device and Physical Data Independence
Views and Derived Data
Lecture 1
David Maier, Judy Cushing
22
Introduction to Database Systems
Study Questions
What 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?
Lecture 1
David Maier, Judy Cushing
23
Introduction to Database Systems
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.
Lecture 1
David Maier, Judy Cushing
24