Download Database Application Design - CLAIR

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
January 7, 2000
Database Application Design
Handout #1
(C) 2000, The
University of Michigan
1
Course information
• Instructor: Dragomir R. Radev
([email protected])
• Office: 305A, WH, Phone: 615-5225
• Office hours: TBD
• Course page:
http://www.si.umich.edu/~radev/654w00/
• Meeting time:
Fridays, 3:00 - 6:00 PM, 311 WH
(C) 2000, The
University of Michigan
2
Books
• Required:
Database Processing by David Kroenke
(7th Edition, Prentice Hall, ISBN 0-13-084816-6)
• Recommended:
MySQL and mSQL by Yarger, Reese, and King
(O'Reilly, ISBN 1-56-592434-7)
(C) 2000, The
University of Michigan
3
Structure of the course
•
•
•
•
Lectures
Assignments
Final project
Final exam
(C) 2000, The
University of Michigan
4
Assignments
• Assignment 1: SQL problem set
• Assignment 2: TBD
(C) 2000, The
University of Michigan
5
Final project
•
•
•
•
•
Proposal
Database design
Progress report
Project
Final presentation
(C) 2000, The
University of Michigan
6
Grading
• Two assignments: 30% (15% each)
• Project: 40%
• Final exam: 30%
(C) 2000, The
University of Michigan
7
Policies
• Attendance counts as 10% of the grade
• Timely submission of assignments is
important
• Syllabus can be amended during the
semester
• Honors Code
(C) 2000, The
University of Michigan
8
Notes on programming
• All students will do some programming as
part of the assignments.
• For the final project, teams will be formed
in ways to include students with diverse
backgrounds.
(C) 2000, The
University of Michigan
9
Syllabus
• 1. Relational Model
– Relations, Domains, Attributes, Keys, Representation,
Manipulation
– Integrity
– Engines: Oracle, MS Access, Sybase, mSQL, MySQL
• 2. SQL
– Syntax and semantics of SQL
– Queries, subqueries, joins
(C) 2000, The
University of Michigan
10
Syllabus
• 3. Programming in SQL
– Use of views
– Queries using EXISTS, set comparison queries
– Outer joins
• 4. Database design
– Data modeling
– Conventions
– Design review
(C) 2000, The
University of Michigan
11
Syllabus
• 5. Application design
– Application structure
– Prototyping
• 6. Web interfaces
– HTML forms
– Dynamic Web pages
– Interface issues
(C) 2000, The
University of Michigan
12
Syllabus
• 7. mSQL, MySQL, and Oracle
– Availability
– Functionality
– Similarities and Differences
• 8. System administration
– Database administration
– Security
(C) 2000, The
University of Michigan
13
Readings for next time
• Kroenke
– Chapter 1: Introduction to Database Processing
– Chapter 2: Introduction to Database
Development
• YRK (optional)
– Chapter 1: Introduction to Relational Databases
– Chapter 2: Database design
(C) 2000, The
University of Michigan
14
Introduction to database
processing
(C) 2000, The
University of Michigan
15
Databases
• Move WWW beyond simple publishing
• Examples:
–
–
–
–
personal : Mary Richards House Painting
workgroup: Treble Clef Music
organizational: DMV licensing and registration
Internet technology: Calvert Island
Reservations
(C) 2000, The
University of Michigan
16
Type
Personal
Example
Typical # of Typical Size of DB
concurrent
users
Mary Richards 1
< 10 MB
House Painting
< 25
< 100 MB
Organizational Licensing and
Registration
Hundreds
> 1 Trillion Bytes
Calvert Island
Reservations
Possibly
hundreds
Any
Workgroup
Internet
Technology
(C) 2000, The
University of Michigan
Treble Clef
Music
17
More examples
• Give examples of databases which you have
been using for research or entertainment.
• Library of congress
• ACL Universe
• Profile
(C) 2000, The
University of Michigan
18
Issues
• Databases vs. database applications?
• Forms, reports, queries
(C) 2000, The
University of Michigan
19
File processing systems (FPS)
Customer
processing
application
Customer
file
Rental
processing
application
Rental
file
Customer file user
Rental file user
(C) 2000, The
University of Michigan
20
Problems with FPS
• Data are separated and isolated
• Data are often duplicated
• Application programs are dependent on file
formats
• Files are often incompatible with one
another
• It is difficult to represent data in the users’
perspectives
(C) 2000, The
University of Michigan
21
Separated and isolated data
• Merging files
• Which parts
• Complexity
(C) 2000, The
University of Michigan
22
Data duplication
• Data integrity
• Updates
• Credibility
(C) 2000, The
University of Michigan
23
Application program dependency
• Format changes
(C) 2000, The
University of Michigan
24
Incompatible files
• Cobol vs. Visual Basic vs. C
(C) 2000, The
University of Michigan
25
Users’ perspectives
• Relationships among records are not easily
represented or processed
• E.g., customer preferences
(C) 2000, The
University of Michigan
26
Database processing systems
•
•
•
•
Integrated data
Reduced data duplication
Program/data independence
Easier representation of the users’
perspectives
(C) 2000, The
University of Michigan
27
Definition of a database
• Self-describing: user data + structure data
(metadata or data directory)
• Collection of integrated records, usually
indexed
• DB is a model of the users’ model
• Transactions
(C) 2000, The
University of Michigan
28
Structure of FPS and DBS
•
•
•
•
•
•
Bytes
Fields
Records
Files
DBS only: Metadata
DBS only: Indexes
(C) 2000, The
University of Michigan
29
The relational Model
• E.F. Codd, “A Relational Model of Data for
Large Shared Databanks” in CACM, June
1970, pp. 377-387
• Data is stored in tables
• Normalization
• Ashton-Tate, then Borland (dBase II)
(C) 2000, The
University of Michigan
30
Client-server database
applications
• Shared files
• Multiple CPUs (cf. mainframe)
• Internet technology
(C) 2000, The
University of Michigan
31
Questions
• Why is database processing an important subject?
• What are the main differences between a single-user and a
multi-user database?
• What are the limitations of file processing systems as
described in the lecture?
• What is a database? Metadata?
• What is the relational model?
• Check out the Web sites of Dell and Amazon. What
databases are involved? Which is the most recent book by
Günter Grass?
(C) 2000, The
University of Michigan
32
Introduction to database
development
(C) 2000, The
University of Michigan
33
Example: registrar’s data
• Relations and tuples
• Example: StudentName, StudentPhone,
AdviserName, AdviserPhone
(C) 2000, The
University of Michigan
34
StudentName
StudentPhone
AdviserName
AdviserPhone
Baker, Rex
232-8897
Parks
236-0098
Charles, Mary
232-0099
Parks
236-0098
Johnson, Beth
232-4487
Jones
236-0110
Scott, Glenn
232-4444
Parks
236-0098
Zylog, Frita
232-5588
Jones
236-0110
(C) 2000, The
University of Michigan
35
Questions
• What happens if Adviser Parks changes his
phone number?
• What is a possible solution?
(C) 2000, The
University of Michigan
36
Use two relations: R1 and R2
R1
StudentName
StudentPhone
AdviserName
Baker, Rex
232-8897
Parks
Charles, Mary
232-0099
Parks
Johnson, Beth
232-4487
Jones
Scott, Glenn
232-4444
Parks
Zylog, Frita
232-5588
Jones
R2
(C) 2000, The
University of Michigan
AdviserName
AdviserPhone
Parks
236-0098
Jones
236-0110
37
SysTables table
Table Name
Number of Columns Primary Key
Student
Adviser
Course
Enrollment
4
3
3
3
(C) 2000, The
University of Michigan
StudentNumber
AdviserName
ReferenceNumber
{StudentNumber,
ReferenceNumber}
38
SysColumns table
Column Name
Table Name
Data Type
Length
StudentNumber
FirstName
LastName
Major
AdviserName
Phone
Department
ReferenceNumber
Title
NumberHours
StudentNumber
ReferenceNumber
Grade
Student
Student
Student
Student
Adviser
Adviser
Adviser
Course
Course
Course
Enrollment
Enrollment
Enrollment
Integer
Text
Text
Text
Text
Text
Text
Integer
Text
Decimal
Integer
Integer
Text
4
20
30
10
25
12
15
4
10
4
4
4
2
(C) 2000, The
University of Michigan
39
CREATE TABLE acllink
(
link_id CHAR(10),
url CHAR(190),
title CHAR(110),
author CHAR(60),
cat1 CHAR(30),
cat2 CHAR(20),
cat3 CHAR(20),
cat4 CHAR(20),
email CHAR(40),
annotation TEXT(50),
date_added TEXT(30),
date_indexed TEXT(30)
)
(C) 2000, The
University of Michigan
40
Related documents