Slides from Lecture 2 - Courses - University of California, Berkeley

Download Report

Transcript Slides from Lecture 2 - Courses - University of California, Berkeley

Database Life Cycle and
Introduction to Access
University of California, Berkeley
School of Information
Management and Systems
SIMS 257: Database
Management
IS 257 - Fall 2002
2002.08.29 - SLIDE 1
Lecture Outline
• Review
• Database Life Cycle
• Access and the Diveshop Database
IS 257 - Fall 2002
2002.08.29 - SLIDE 2
Lecture Outline
• Review
• Database Life Cycle
• Access and the Diveshop Database
IS 257 - Fall 2002
2002.08.29 - SLIDE 3
Database Environment
CASE
Tools
Repository
IS 257 - Fall 2002
User
Interface
DBMS
Application
Programs
Database
2002.08.29 - SLIDE 4
Database Components
DBMS
===============
Design tools
Database
Database contains:
User’s Data
Metadata
Indexes
Application Metadata
IS 257 - Fall 2002
Table Creation
Form Creation
Query Creation
Report Creation
Procedural
language
compiler (4GL)
=============
Run time
Form processor
Query processor
Report Writer
Language Run time
Application
Programs
User
Interface
Applications
2002.08.29 - SLIDE 5
Terms and Concepts
•
•
•
•
•
•
•
•
•
•
Database
DBMS
Enterprise
Entity
Attributes
Data values
Records
File
Key
Primary Key
IS 257 - Fall 2002
2002.08.29 - SLIDE 6
Terms and Concepts
•
•
•
•
•
•
Data Dictionary
Data Administration
Database Administration
Data Steward
DA
DBA
IS 257 - Fall 2002
2002.08.29 - SLIDE 7
Terms and Concepts
• Data Independence
• Models
– (1) Levels or views of the Database
• Conceptual, logical, physical
– (2) DBMS types
• Relational, Hierarchic, Network, ObjectOriented, Object-Relational
• Metadata
IS 257 - Fall 2002
2002.08.29 - SLIDE 8
Models (1)
Application 1
External
Model
Application 2
Application 3
Application 4
External
Model
External
Model
External
Model
Application 1
Conceptual
requirements
Application 2
Conceptual
requirements
Application 3
Conceptual
requirements
Conceptual
Model
Logical
Model
Internal
Model
Application 4
Conceptual
requirements
IS 257 - Fall 2002
2002.08.29 - SLIDE 9
Data Models(2): History
• Hierarchical Model (1960’s and 1970’s)
– Similar to data structures in programming
languages.
Books
(id, title)
Authors
(first, last)
IS 257 - Fall 2002
Publisher
Subjects
2002.08.29 - SLIDE 10
Data Models(2): History
• Network Model (1970’s)
– Provides for single entries of data and
navigational “links” through chains of data.
Authors
Subjects
Books
Publishers
IS 257 - Fall 2002
2002.08.29 - SLIDE 11
Data Models(2): History
• Relational Model (1980’s)
– Provides a conceptually simple model for data
as relations (typically considered “tables”) with
all data visible.
pubid
Book ID
1
2
3
4
5
Title
pubid
Introductio
The history
New stuff ab
Another title
And yet more
IS 257 - Fall 2002
2
4
3
2
1
Author id
1
2
3
4
5
1
2
3
4
Book ID
pubname
Harper
Addison
Oxford
Que
Authorid
1
2
3
4
5
Author name
Smith
Wynar
Jones
Duncan
Applegate
Subid
1
2
3
4
4
2
1
3
2
3
Subid
Subject
1 cataloging
2 history
3 stuff
2002.08.29 - SLIDE 12
Data Models(2): History
• Object Oriented Data Model (1990’s)
– Encapsulates data and operations as
“Objects”
Books
(id, title)
Authors
(first, last)
IS 257 - Fall 2002
Publisher
Subjects
2002.08.29 - SLIDE 13
Data Models(2): History
• Object-Relational Model (1990’s)
– Combines the well-known properties of the
Relational Model with such OO features as:
• User-defined datatypes
• User-defined functions
• Inheritance and sub-classing
IS 257 - Fall 2002
2002.08.29 - SLIDE 14
Lecture Outline
• Review
• Database Life Cycle
• Access and the Diveshop Database
IS 257 - Fall 2002
2002.08.29 - SLIDE 15
Database System Life Cycle
Physical
Creation
2
Conversion
3
Design
1
Growth,
Change, &
Maintenance
6
Integration
4
Operations
5
IS 257 - Fall 2002
2002.08.29 - SLIDE 16
The “Cascade” View
Project
Identifcation
and Selection
Project
Initiation
and Planning
Analysis
Logical
Design
Physical
Design
Implementation
See Hoffer, p. 41
IS 257 - Fall 2002
Maintenance
2002.08.29 - SLIDE 17
Design
• Determination of the needs of the
organization
• Development of the Conceptual Model
of the database
– Typically using Entity-Relationship
diagramming techniques
• Construction of a Data Dictionary
• Development of the Logical Model
IS 257 - Fall 2002
2002.08.29 - SLIDE 18
Physical Creation
• Development of the Physical Model of
the Database
– data formats and types
– determination of indexes, etc.
• Load a prototype database and test
• Determine and implement security,
privacy and access controls
• Determine and implement integrity
constraints
IS 257 - Fall 2002
2002.08.29 - SLIDE 19
Conversion
• Convert existing data sets and
applications to use the new database
– May need programs, conversion utilities to
convert old data to new formats.
IS 257 - Fall 2002
2002.08.29 - SLIDE 20
Integration
• Overlaps with Phase 3
• Integration of converted applications and
new applications into the new database
IS 257 - Fall 2002
2002.08.29 - SLIDE 21
Operations
• All applications run full-scale
• Privacy, security, access control must be in
place.
• Recovery and Backup procedures must be
established and used
IS 257 - Fall 2002
2002.08.29 - SLIDE 22
Growth, Change & Maintenance
• Change is a way of life
– Applications, data requirements, reports, etc.
will all change as new needs and
requirements are found
– The Database and applications and will need
to be modified to meet the needs of changes
IS 257 - Fall 2002
2002.08.29 - SLIDE 23
Another View of the Life Cycle
Integration
4
Operations
5
Design
Physical
1
Creation Conversion Growth,
2
Change
3
6
IS 257 - Fall 2002
2002.08.29 - SLIDE 24
Lecture Outline
• Review
• Database Life Cycle
• Access and the Diveshop Database
IS 257 - Fall 2002
2002.08.29 - SLIDE 25
Test Database
• The DiveShop database contains
information for the business operations
of a skin & scuba diving shop that:
– Organizes trips to particular locations
(destinations) with various dive sites
– Dive sites have various features including
• types of marine life found there
• other features (like shipwrecks)
– Rents/Sells equipment to dive customers
for particular trips.
IS 257 - Fall 2002
2002.08.29 - SLIDE 26
ER Diagrams
• Entity-Relationship Diagrams are one of
the main tools for database design
• We will examine ER diagrams in greater
detail later
• ER Diagrams show Entities (rectangles)
and their attributes (ovals) and the
relationships between entities (diamonds)
IS 257 - Fall 2002
2002.08.29 - SLIDE 27
Diveshop Entities: SITES
Site
Highlight
Site
Notes
Site Name
Destination
no
Distance
From Town (M)
Distance
From Town (Km)
Depth (ft)
Sites
Site no
Depth (m)
Visibility(ft)
Skill Level
Visibility (m)
Current
IS 257 - Fall 2002
2002.08.29 - SLIDE 28
Diveshop Entities: DIVECUST
City
State/Prov
Street
Name
Customer no
IS 257 - Fall 2002
ZIP/Postal
Code
Country
DiveCust
Phone
First
Contact
2002.08.29 - SLIDE 29
Diveshop Entities: DEST
Spring Spring
Avg Temp (C)Temp (F) Summer
Temp (C)
Temp (C)
Avg
Summer
Temp (F)
Temp (F)
Destination
name
Dest
Destination no
Accommodations
Travel
Cost
Body of
Water
IS 257 - Fall 2002
Fall
Temp (C)
Fall
Temp (F)
Winter
Winter Temp (C)
Temp (F)
Night
Life
2002.08.29 - SLIDE 30
Diveshop Entities: BIOLIFE
Species
Name
Common
Name
Category
Length
(cm)
Length
(in)
Notes
external
BioLife
Graphic
external
Species no
IS 257 - Fall 2002
2002.08.29 - SLIDE 31
Diveshop Entities: SHIPWRCK
Type
Interest
Tonnage
Length
(ft)
Category
Site no
Shipwrck
Ship Name
Graphic
external
IS 257 - Fall 2002
Condition
Passengers/
Cause
Crew
Survivors Comments Date
external Sunk
Length
(m)
Beam
(ft)
Beam
(m)
2002.08.29 - SLIDE 32
Diveshop Entities: DIVESTOK
Reorder
Point
On Hand
Cost
Equipment
Class
Description
Sale
Price
DiveStok
Rental
Price
Item No
IS 257 - Fall 2002
2002.08.29 - SLIDE 33
Diveshop Entities: DIVEORDS
Ship
Via
Sale
Date
Customer
No
DiveOrds
Order no
CCNumber
Vacation
Cost
Destination
Return
Date
IS 257 - Fall 2002
Payment
Method
CCExpDate
No of
People
Depart
Date
2002.08.29 - SLIDE 34
Diveshop Entities: DIVEITEM
Rental/
Sale
Item no
DiveItem
Qty
Line
Note
Order no
IS 257 - Fall 2002
2002.08.29 - SLIDE 35
Diveshop Entities: BIOSITE
Species
No
Site
No
BioSite
IS 257 - Fall 2002
2002.08.29 - SLIDE 36
Diveshop Entities: SHIPVIA
Ship
Via
Ship
Cost
ShipVia
IS 257 - Fall 2002
2002.08.29 - SLIDE 37
DiveShop ER Diagram
Customer
No
Destination
Name
Destination
no
DiveCust
Customer
No
1
ShipVia
DiveOrds
n
Dest
1
Destination
no
Site No
ShipVia
n
Destination
1
n
Order
No
ShipVia
1
1
Order
No
n
Sites
n
Site No
1
n
BioSite
Species
No
DiveItem
1
Item
No
1/n
ShipWrck
n
n
Site No
1
Species
No
BioLife
IS 257 - Fall 2002
1
DiveStok
Item
No
2002.08.29 - SLIDE 38
Assignment 1 (also online)
• How many tons was the sunken ship Delaware?
• What is customer Karen Ng’s address?
• At what destinations and sites might you find a
Spotted Eagle Ray?
• Where (what destination) is the site Palancar
Reef?
• What sites might Lorraine Vega dive on her trip?
• Keith Lucas wants to see a shipwreck on his trip.
Is he going to the right place?
• What equipment is Richard Denning getting?
• What is the cost of the equipment rental for
Louis Jazdzewski
IS 257 - Fall 2002
2002.08.29 - SLIDE 39
Assignment 1: cont.
• The Database is available on the course
web site
• Download your own copy
• For each of the questions create a query
in Access.
• Create a document (Word, etc.) containing
– The query being answered
– The results of your query cut and pasted from
Access
• Due Tuesday Feb. 3
IS 257 - Fall 2002
2002.08.29 - SLIDE 40