Class363 1

33
Introduction to Database Systems Lecture #1 Dated: 19-10-2007

description

 

Transcript of Class363 1

Page 1: Class363 1

Introduction to Database Systems

Lecture #1

Dated: 19-10-2007

Page 2: Class363 1

Classes: 01:30 PM – 03:00 PM Thursday11:30 AM – 01:00 PM Friday

Instructor: Nauman Riaz Chaudhry Cell: 0300-9503200 Email: [email protected]

Page 3: Class363 1

Course Overview

Background and History Data Models

E/R Model Relational Model Object Oriented Model XML and Database

Database Programming Relational Algebra SQL Object Oriented

Page 4: Class363 1

Textbook

C. J. Date “An Introduction to Database Systems ”, Seventh Edition, Pearson Education

Jeffrey D. Ullman and Jennifer Widom, “A First Course in Database Systems”, Second Edition, Prentice Hall, 2001

Other useful textbooks: Fundamentals of Database Systems (Elmasri and

Navathe) Database System Concepts (Abraham Siberschatz, Henry

F.Korth and S.Sudarshan) Database Management Systems (Ramakrishnan)

Page 5: Class363 1

Tentative Schedule

Introduction (1-2 classes) E/R Model (2-3 classes) Relational Model (3-4 classes) Other Models (2-3 classes) Relational Algebra (3-4 classes) SQL (4-5 classes) Constraints and triggers (1-2 classes) System Aspects of SQL (3-4 classes) XML (3-4 classes)

Page 6: Class363 1

Course Load

3 - 5 homework assignments 1 project 5 Quiz's A Midterm Exam A Final Exam

Homework and project assignments are due in the beginning of class one or two weeks that follows. Late homework will not be accepted, and a score of zero will be assigned for that assignment.

Page 7: Class363 1

Course Policy

exams: no access to any material nor discussion with anyone (except the instructor) is allowed.

assignments: solutions should be developed independently. Stealing, giving or receiving any code drawings, diagrams, text, or designs from another person is not allowed.

max penalty for academic dishonesty: F in the course; reported to the university.

Page 8: Class363 1

Grading Policy

The grade will be calculated using the following weights: Homework and Quizzes 15% Project 10% Mid-term Exams 25% Final Exam 50%

Page 9: Class363 1

Starting from now … Something completely different!

Page 10: Class363 1

What is Database?

Essentially, a database is a set of data, or a collection of information. These data are related.

Examples: Student Information

human genome sequence company products information

Page 11: Class363 1

More Examples

Airline Reservation Systems Reservations by a single customer on a single flight,

including such information as assigned seat or meal preference

Information about the flight, the airports thy fly from and to, the departure and arrival times, etc.

Ticket prices, requirements, and availability

Banking Systems Customers, accounts, loans and the balances Deposit or withdraw money

Page 12: Class363 1

What’s DBMS?

DataBase Management System (DBMS) A powerful tool for creating and manage large

amounts of data efficiently and allowing it to persist over long periods of time, safely. It also provides efficient accesses to multiple users.

It is used to manage databases.

Page 13: Class363 1

DBMS capabilities

Persistent Storage Programming Interface Transaction management

Page 14: Class363 1

DBMS capabilities (Cont.)

Allow users to create databases and specify their schema, using data-definition language.

Allow users to query and modify the data, using data-manipulation language.

Support the storage of very large amount of data over a long period.

Data consistency and failure recovery.

Page 15: Class363 1

File System

Why not using file system? Can be used to store data information for a long

period as well. Consistency and failure recovery capability

Problems: no query language, no efficient access for a data

item support of the creation of database is limited consistency control is not adequate

Management of Data is complex

Page 16: Class363 1

DBMS Evolution

File Systems Hierarchical Model (Tree-based) Network Model (Graph-based) Relational Model Object Oriented Model Object/Relational Model

Page 17: Class363 1

Relational Database System

Ted Codd 1970 The view of data: relations relations, tuples, attributes tables, rows, columns Queries could be expressed in high level

language, it is simple and efficient It is widely used in most commercial

systems

Page 18: Class363 1

Example 1.1

AccountNo Balance Type

12345 1000.00 Savings

67890 2846.92 checking

… … …

Bank Account Information(Accounts)

Page 19: Class363 1

Example 1.1 (Cont.)

Check the balance SELECT balance

FROM Accounts WHERE accountNo= 67890 Check the accountNo SELECT accountNo

From Accounts WHERE type=‘savings’ AND balance < 0

Page 20: Class363 1

Major DBMS Products

Oracle IBM: DB2, Informix Microsoft: SQL Server, Access Sybase MySQL Postgres

All are "relational" (or "object-relational") database systems at their core.

Page 21: Class363 1

Schema versus data

Schema describes how data is to be structured - defined at set-up time, rarely changes (part of the "metadata")

Data is actual "instance" of database, may change rapidly

Comparable to types and variables in programming languages

Page 22: Class363 1

Data Definition Language (DDL)

Commands for setting up schema of database

Process of designing schema can be complex, may use design methodology and/or tool

Page 23: Class363 1

Data Manipulation Language (DML)

Commands to manipulate data in database: RETRIEVE, INSERT, DELETE, MODIFY

Also called "query language"

Page 24: Class363 1

People

DBMS implementer: builds system Database designer: establishes

schema Database administrator: loads data,

keeps whole thing running Database user: queries/modifies data

Page 25: Class363 1

DBMS Evolution Trends

Size smaller and smaller using personal computer, similar to applications such as

spreadsheet and word processing bigger and bigger terabytes or even petabytes data, using tertiary storage

and parallel computing techniques. Architecture Client-server architecture (Two-Tier) client database Server Multi-Tier architecture: client application server database server

Page 26: Class363 1

DBMS Trends (Cont.)

Versatile Data type integers, characters

small storage requirement

videos, audios large storage requirement

Integration Data warehouses, data mining

Page 27: Class363 1
Page 28: Class363 1

Overview of DBMS

DDL commandsDBA DDL Complier Execution engine

… Query Processing

Answering the queryUser Query Compiler Execution engine

… Transaction processing

Page 29: Class363 1

Storage and Buffer Management

Buffer manager Storage manager

Data: the contents of the database Metadata (Schema) : structure of the

database Statistics: data properties Indexes

Page 30: Class363 1

Transaction Processing

Transaction manager Logging Concurrency control Deadlock resolution

Page 31: Class363 1

Query Processor

Query complier Query parser Query preprocessor Query optimizer

Execution engine

Page 32: Class363 1

Outline of Database System

Database designDetermine the database structure

Database programmingPerform database operations

Database system implementationBuild the database

Page 33: Class363 1

Next Class

E/R Concepts