Você está na página 1de 27

InfSci 2710: Database Management

Lecture 1
1/9/2001

General Course Information


InfSci 2710 Database Management
Spring 2001 (CRN:18928)
Class meets on Tuesdays 6:00pm-8:50pm.
Crawford Hall 169
Course Web Page at:
http://www2.sis.pitt.edu/~pwu/DBMS-012/DBMS.html
Use CourseInfo for questions, to check current scores:

1
Course Objectives
Intro to Database Management Systems
Theory of Data Modeling for database design
Entity-Relationship Model
Relational Model, and Relational Algebra
Use of SQL
Use of DBMS such as Oracle, MS Access.

Course Objectives
Database Programming
PL/SQL (database server programming)
Java and JDBC (database application programming)
Physical Database: file and index structures
Database System issues:
Database Architecture
Transaction Management
Concurrency Control
Database Recovery and Security

2
Prerequisites
2610 Data Structures
not much more than B-Trees
Programming Skills essential:
will learn PL/SQL
exercise of programming in Java and JDBC
Need to use logic and set languages

Textbooks
Fundamentals of Database Systems (3rd ed)
- Elmarsi and Navathe. Addison Wesley, 2000.
Will cover most of parts 1 to 5.
Refer to class schedule for reading list.
Oracle8 Programming: A Primer
- R. Sunderraman. Addison Wesley, 2000.
To learn Oracle, SQL, and use of JDBC.

3
Reference Books
Practical Issues in Database Management
- F. Pascal. Addison Wesley 2000
for a more thorough treatment on many practical
issues on relational database systems
Java: How to Program (3rd edition)
- Deitel and Deitel. Prentice Hall, 1999.
to learn Java, and use of JDBC (chapter18).
Principles of Database Systems with Internet and
Java Applications
- G. Riccardi. Addison Wesley 2001
somewhat brief on theory and database design, but
much more discussion on web-based databases.

Oracle
Get an account to use the Sun Workstation Lab.
I will get you an account to access Oracle, if
you dont have one already.
You can get Personal Oracle 8 for your PC
running Windows 95/98/2000/NT from
Software Licensing Services (for $5 per CD) so
that you can install the software at home.
Software Licensing Service: Bellefield Hall 203
See http://www.technology.pitt.edu/software/index.html

4
MS Access
SIS Pentium Lab (Room 838).
Students can pick up (free of charge) a CD for
Microsoft Campus Software at the Software
Licensing Service; Office 2000 for Windows
which includes MS Access.
Software Licensing Service: Bellefield Hall 203
See http://www.technology.pitt.edu/software/index.html

Main Topics in the Course


Data Models and Data Modeling
ER Model, Relational Model
Using SQL in Oracle and/or MS Access
Database Programming
PL/SQL, Java and JDBC.
File and Index Structures
Database System issues:
database architecture
transaction management, concurrency control.
database recovery and security

5
Class Schedule
Jan 09 Introduction, Schema.
Jan 16 Entity-Relationship Model
Jan 23 Extended Entity-Relationship Model
Jan 30 Relational Model, Relational Algebra
Feb 06 ER to Relational map, Normalization
Feb 13 SQL
Feb 20 SQL
Feb 27 Mid-Term Exam

Class Schedule
Mar 06 (spring break)
Mar 13 PL/SQL: Server programming
Mar 20 Java/JDBC: Application Programming
Mar 27 File and Index Structures
Apr 03 Database Architectures, System Catalog
Apr 10 Transactions, Concurrency Control
Apr 17 Database Recovery and Security
Apr 24 Final Exam

6
Grading
8 to 9 Homework Assignments 40%
(if we have 9; will count only best 8 scores)
Two exams: Mid-Term and Final.
The better one counts 35%, the other 25%.
There may be quiz in class, for discussion only.
Takes attendance, but not counted for grading.

Homework Policy
Late Homework
Will discuss answers in class on due date.
Late homework gets at most only 75% score.
Will not consider those more than one week late.
Group Homework
Group up to 4 persons acceptable.
All get same score but each individual member
must be able to explain any part of work submitted.
OK to work with different groups for different
homework assignments.

7
Exams
Open book, open notes.
But will still need preparation.
Each exam may take up to two hours;
Will then use the rest of lecture time to
discuss answers.

Questions and Comments

Welcome any time in class.


Other times, use discussion forum in CourseInfo.
For discussion in person, visit during office hours, or
use e-mail to arrange an appointment.
If you miss a class, please review course web page and
course materials, and get assignments.
Appreciate correction of errors and mistakes, comments
as well as suggestions in teaching.

8
Certification Programs
Oracle 8 Certified Database Administrator
Have to pass 5 exams. This course will cover about 80 to
90% of the material of the first exam (SQL, PL/SQL). See
the site at http://education.oracle.com/certification/.
Book: Oracle8 Certified Professional DBA Certification
Exam Guide Jason S. Couchman, Osbourne 1999.
Book: Oracle Certified Professional Application
Developer Exam Guide C. Allen, Osbourne 1999.

IBM DB2 Certification:


http://www.software.ibm.com/data/db2/udb/db2cert.html.
Book: DB2 Universal Database Certification Guide
Calene Janacek et al. Prentice Hall, 1997.

Tell me about yourself.

I want to know about your backgrounds


Green sheet (also on course web page)
Please fill out and return now.
Add one thing to Research Interests
Your prior training: degree and field of study.

9
InfSci 2710: Database Management

Introduction to Database Management

Reading
Textbook
Chapter1
Databases and Database Users
Chapter 2
Database System Concepts and Architecture

10
Topics

1. Persistence, State, Schema, Database Systems


2. Data Independence, 3-Schema Architecture
3. Database Users and Database Tools
4. Summary

Persistence
Output is always a function of input.
today
5 120
factorial

tomorrow
5 120
factorial

The system does not need persistence.

11
Persistence
Output depends on some internal state.
today
5 120
balance

tomorrow
5 100
balance

The system state must be persistent.

Persistence
Persistent information is kept beyond the life
of a single process of program execution.

5 100
balance

Balance information of
account 5 kept persistent.

12
Keeping information persistent
Put the information into a file.
Must make sure the information is properly
updated when the program is in use.
Operating System keeps file on disk.
Disk is persistent memory.
File systems on disk are predecessors of
modern database management systems.

Schema format information


But a file is nothing more than a collection
of records, and each record is but a
collection of data bytes.
00001 120.00
00002 100.25
00003 99.55
00004 1000.00
00005 100.00

Format of the persistent information is in


the heads of the programmers, or embedded
in the application programs.

13
Schema format information
Keep format information along with data.
File structure is thus formally documented.
System can prevent data type errors in the
application programs.
Programming is simpler can work at a
higher level of abstraction.

Database Schema
Example of data definition using SQL:
CREATE TABLE ACCOUNT
(AcctNo NUMBER(5),
Balance NUMBER(10,2))
00001 120.00
00002 100.25
00003 99.55
00004 1000.00
00005 100.00

14
Database Schema
Formal definition of the structure of the
database contents.
Data Definition Language (DDL)
Determines the possible database states.
Define only once at database creation.

Database States
an instance of the schema
State changes must conform to schema.
State information kept persistent.
May change as often as needed.
Data Manipulation Language (DML)
High level DML: declarative
Low level DML: procedural - programming

15
Database Example (Relational)
Account No Balance
00001 120.00
00002 100.25
00003 99.55
00004 1000.00
00005 100.00

Data Model
Refers to the underlying model of database states.
Can be expressed in a precise formal language.
Examples of Data Models:
Entity-Relationship Model
Relational Model
Network Model
Hierarchical Model
Object Oriented Model

16
Database Management System

Application independent software which implements a


data model, to allow
definition of database schema for different applications
maintenance of persistent state information
management of change of database states
Examples:
Oracle, MS Access, DB2, Sybase, Informix, Ingres

Database Systems
for a specific application
deployment of a DBMS of choice to define,
construct, and manipulate the database
Examples
Airline Reservation System
Student Registration Information System
Billing and Customer Care System

17
Database System Architecture
User User

Application Program DBMS Tools

Database Management System (DBMS)

Database Database
Schema States

Topics

1. Persistence, State, Schema, Database Systems


2. Data Independence, 3-Schema Architecture
3. Database Users and Database Tools
4. Summary

18
Data Independence
DBMS is a layer of software above the OS.
Most DBMSs use the file system to store data.
User can access these files only via the DBMS.
DBMS is thus a library of subprograms to
access the files database schema and states.
Indirection gives the possibility to hide internal
changes. (Why make internal changes?)

Data Independence
For example, automatic reorganization of
indexes upon changes in database states.
Without DBMS, these changes need to be
made explicitly user needs to be aware.
With DBMS, implementation of the schema
is made independent from the use of data.

19
Data Independence
User defines database with the schema,
without worrying about physical
implementation.
User constructs and manipulates database
by changing database states, without
concern about implementation data formats.

Data Independence
Conceptual Database Schema (Interface)
Logical information about the content of the database
Complications about implementation are hidden
Internal/Physical Database Schema (Implementation)
Data format information
Index information
Physical placement or storage to administer access

20
Data Independence
Example of SQL Query:
SELECT X.Balance
FROM Account X
WHERE X.AcctNo = 00005
User enters query according to conceptual schema.
DBMS translates that into an execution plan
according to the schema.
The system executes the translated query on the
actual stored data according to the internal schema.
DBMS translates the result back to the level of
abstraction at the conceptual schema.

Data Independence
Physical Data Independence
refers to the hiding of implementation
information.
Logical Data Independence
refers to the modular organization of data
and the schema to allow different
applications to have different views of data.

21
Three-Schema Architecture
Design of a conceptual schema to support multiple
views in different applications.
Different users may have different views

External View 1 External View 2 ..

Conceptual Schema

Internal Schema

Topics

1. Persistence, State, Schema, Database Systems


2. Data Independence, 3-Schema Architecture
3. Database Users and Database Tools
4. Summary

22
Database Users
Database Administrator
Application Programmer
Sophisticated User
Nave User
Parametric User

Database Users
Database Administrator:
knows the complete DB schema admin.
changes schema if necessary maintenance.
grants access rights to users security.
ensures backup and recovery after failure care.
monitors disk space usage care.
monitors system performance oversight.
defines/advices on system policies management.
installs new versions of DBMS software

23
Database Users
Application Programmer:
writes programs for standard tasks such as
account credit/debit programs for nave users.
knows programming, development tool, and the
programming interface well; should also know
SQL well.
may also be developing web interface for
unknown users.
usually supervised by the database administrator.

Database Users
Sophisticated User:
knows SQL well and/or other query tools.
knows the data schema quite well.
often needs to do non-standard evaluation as well
as processing of data
mid-level managers who may need to discover
new statistics for decision support.

24
Database Users
Nave User:
uses standard application programs to work on
the database system.
usually does the work of data entry.
also called Parametric User such as cashier,
bank teller, phone order entry clerk, etc.

Database Tools
Database Server
Interactive SQL Interpreter
Application Program Interface programming tool
Graphical/Menu-based query tool
Report Generator canned tools
Data Import/Export
Performance monitoring
Backup/Restore system tools

25
Database Users and Tools
Parametric (Novice) User

Sophisticated User DBA Staff


Application Programs
(Canned Tools)
SQL Interpreter System Tools
API

Application
Programmer Database Management System (DBMS)

Storage Manager

Database Database
Schema States

Topics

1. Persistence, State, Schema, Database Systems


2. Data Independence, 3-Schema Architecture
3. Database Users and Database Tools
4. Summary

26
Summary
Database System:
Persistence of information
Integrated system to serve many views and
many users simultaneously
Data independence (DBMS: schema, data..)
Database system in use:
Standard processes
Ad-hoc (non-standard) processes
Administrative processes

Database Management
In this course
Database Design:
Conceptual schema (Entity-Relationship Model)
Logical schema (Relational Model)
Database Use:
Definition (SQL)
Construction initial loading (SQL, or other tools)
Manipulation
ad-hoc processing (SQL)
server programming (PL/SQL)
application programming (Java with JDBC)

27

Você também pode gostar