Uploaded by Ahmed Sayed

Elmasri 6e Ch01

advertisement
Chapter 1
Databases and
Database Users
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Course Outline
Course
No
INF 372
Course
Title
Database
Management
Systems
Hrs / week
Year
Lect Lab
3
2
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
2019/ 2020
Exam
Semester
Hours
Second
3
Assessments Methods:
 Assessment




Midterm Exam
Oral Examination
Practical Examination
Final-term Examination
 Total
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
weight
10%
10%
15%
65%
100 %
Course Resources
 Textbook :

Elmasri Ramez, and Sham Navathe.
Fundamentals of Database Systems. Sixth
edition, Boston: Pearson/Addison Wesley.2011
 Additional Materials:

Lecture Slides.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Course contents

Databases and Database Users

The Relational Data Model and Relational Database Constrain

Relational Database Design by ER- and EER-to-Relational Mapping

The Relational Algebra and Relational Calculus

Data Modeling Using the Entity-Relationship (ER) Model

The Enhanced Entity-Relationship (EER) Model

Basic SQL

Basics of Functional Dependencies and Normalization for Relational Databases
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Chapter 1 Outline

Introduction

Types of Databases and Database Applications

Basic Definitions

Typical DBMS Functionality

An Example

Characteristics of the Database Approach

Actors on the Scene

Workers behind the Scene

Advantages of Using the DBMS Approach
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Introduction

Databases and database systems are an essential component of life in
modern society:

There are several activities that involve some interaction with a database.

For example,


If we go to the bank to deposit or withdraw funds,

If we make a hotel or airline reservation,

If we purchase something online such as a book, toy, or computer
For these activities, there is a need some computer program accessing
a database.

Even purchasing items at a supermarket often automatically updates the
database that holds the inventory of grocery items.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Types of Databases and database Applications
•Extract and analyze useful business
Traditional
database
applications
•Numerical and textual databases
Store textual or numeric information
information from very large databases
•Support decision making
Data
warehouses
and online
analytical
processing
(OLAP)
systems
Types of
Databases
Multimedia
databases
•Store images, audio clips, and
video streams digitally
•Store and analyze maps, weather
Geographic
information
systems
(GIS)
data, and satellite images
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Types of Databases and database
Applications


Traditional database applications

Numerical and textual databases

Store textual or numeric information
Multimedia databases


Geographic information systems (GIS)


Store images, audio clips, and video streams digitally
Store and analyze maps, weather data, and satellite images
Data warehouses and online analytical processing (OLAP) systems

Extract and analyze useful business information from very large databases

Support decision making
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Basic Definitions

Database



Collection of related data
Data

Known facts that can be recorded and that have implicit meaning.

For example: names, telephone numbers, and addresses.
Mini-world or Universe of Discourse (UoD)

Represents some aspect of the real world which is stored in a database.

Logically coherent collection of data with inherent meaning

Built for a specific purpose

For example, student grades at a university.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Basic Definitions (cont'd.)

Example of a large commercial database



Amazon.com
Database Management Systems (DBMS)

Collection of programs

Enables users to create and maintain a database
Database system

The DBMS software together with the data itself. Sometimes, the
applications are also included.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Basic Definitions (cont'd.)
 Application program

Accesses database by sending queries to DBMS
 Query

Causes some data to be retrieved
 Transaction

May cause some data to be read and some data to be written into
the database
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Typical DBMS Functionality

Defining a database



Meta-data

Database definition or descriptive information

Stored by the DBMS in the form of a database catalog or dictionary
Constructing



Specify the data types, structures, and constraints of the data to be stored in the database
Is the process of storing the data on some storage medium that is controlled by the DBMS
Manipulating a database

Retrieval: Querying, generating reports

Modification: Insertions, deletions and updates to its content
Sharing a database

Allow multiple users and programs to access the database simultaneously
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Typical DBMS Functionality (cont'd.)
 Protecting a database:

System protection (against hardware or software malfunction)

Security protection (against unauthorized access)
 Maintain the database system

Allow the system to evolve as requirements change over time
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
An Example
 UNIVERSITY database (mini-world)

Information concerning students, courses, and grades in a
university environment
 Data records (Mini-world entities)

STUDENT

COURSE

SECTION

GRADE_REPORT

PREREQUISITE
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
An Example (cont'd.)

Specify structure of records of each file by specifying data type for each data
element


String of alphabetic characters

Integer

Etc.
Construct UNIVERSITY database

Store data to represent each student, course, section, grade report, and
prerequisite as a record in appropriate file

Relationships among the records

Manipulation involves querying and updating
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Example of a Database
(with a Conceptual Data Model)
 Some mini-world relationships:

SECTIONs are of specific COURSEs

STUDENTs take SECTIONs

COURSEs have prerequisite COURSEs
 Note: The above entities and relationships are typically expressed in
a conceptual data model, such as the ENTITY-RELATIONSHIP data
model.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 1- 17
An Example (cont'd.)

Examples of queries:

Retrieve the transcript

List the names of students who took the section of the ‘Database’ course offered in
fall 2008 and their grades in that section


List the prerequisites of the ‘Database’ course
Examples of updates:

Change the class of ‘Smith’ to sophomore

Create a new section for the ‘Database’ course for this semester

Enter a grade of ‘A’ for ‘Smith’ in the ‘Database’ section of last semester
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Simplified database system environment
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Characteristics of the Database Approach

Traditional file processing

Each user defines and implements the files needed for a specific software
application

Database approach

Central repository of a shared data

Single repository maintains data that is defined once and then accessed
by various users

Data is managed by a controlling agent

Stored in a standardized, convenient form.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Disadvantages of File Processing
 Program-data Dependence

All programs maintains metadata for each file they use
 Duplication of data

Different systems/programs have separate copies of the same
data
 Limited data sharing

No centralized control of data
 Lengthy development time

Programmers must design their own file formats
 Excessive program maintenance
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Characteristics of the Database
Approach (cont'd.)
 Main characteristics of database approach

Self-describing nature of a database system
 Insulation between programs and data, and
data abstraction
 Support of multiple views of the data
 Sharing of data and multiuser transaction
processing
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Self-Describing Nature of a
Database System
 A DBMS catalog stores the description of a particular database
(e.g. data structures, types, storage format and constraints)
 The description is called meta-data.
 Meta-data

Describes structure of the database
 Database catalog used by:

DBMS software

Database users who need information about database
structure
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Example of a simplified database catalog
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 1- 25
Insulation Between Programs and
Data
 Called Program-data independence

Structure of data files is stored in DBMS catalog separately from
access programs

Allows changing data structures and storage organization without
having to change the DBMS access programs.
 Program-operation independence

Operations specified in two parts:
• Interface includes operation name and data types of its
arguments
• Implementation can be changed without affecting the interface
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Data Abstraction
 Data abstraction

Allows program-data independence and program-operation
independence

A data model is used to hide storage details and present the
users with a conceptual view of the database.

Programs refer to the data model constructs rather than data
storage details
 Conceptual representation of data

Does not include details of how data is stored or how operations
are implemented
 Data model

Type of data abstraction used to provide conceptual
representation
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Support of Multiple Views of the Data
 Each user may see a different view of the database, which
describes only the data of interest to that user
 View

Subset of the database

Contains virtual data derived from the database files but is
not explicitly stored
 Multiuser DBMS

Users have a variety of distinct applications

Must provide facilities for defining multiple views
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Sharing of Data and Multiuser
Transaction Processing
 Allow multiple users to access the database at the same time
 Concurrency control software

Ensure that several users trying to update the same data do so in
a controlled manner
• So that Result of the updates is correct
 Recovery subsystem ensures each completed transaction has its
effect permanently recorded in the database
 Online transaction processing (OLTP) application

is a major part of database applications. This allows hundreds of
concurrent transactions to execute per second
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Sharing of Data and Multiuser
Transaction Processing (cont'd.)
 Transaction

Central to many database applications

Is an executing program or process that includes one or more
database accesses such as reading or updating of a database
records.

Isolation property
• Each transaction appears to execute in isolation from other
transactions

Atomicity property
• Either all the database operations in a transaction are
executed or none are
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Database Users
 Users may be divided into

Those who actually use and control the database content, and
those who design, develop and maintain database applications
(called “Actors on the Scene”), and

Those who design and develop the DBMS software and related
tools, and the computer systems operators (called “Workers
Behind the Scene”).
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 1- 31
Actors on the Scene
 Database administrators (DBA) are responsible for:

Authorizing access to the database

Coordinating and monitoring its use

Acquiring software and hardware resources
 Database designers are responsible for:

Identifying the data to be stored

Choosing appropriate structures to represent and store this data
 System analysts

Determine requirements of end users
 Application programmers (software engineers)

Implement these specifications as programs

Test / document / maintain programs
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Actors on the Scene (cont'd.)
 End users

People whose jobs require access to the database

Types
• Casual end users: access database occasionally when
needed
• Naive or parametric end users: they make up a large section
of the end-user population.
• They use previously well-defined functions in the form of
“canned transactions” against the database.
• Examples are bank-tellers or reservation clerks who do
this activity for an entire shift of operations.
• Sophisticated end users
• Standalone users
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Categories of End-users
(continued)
• Sophisticated:
• These include business analysts, scientists, engineers,
others thoroughly familiar with the system capabilities.
• Many use tools in the form of software packages that work
closely with the stored database.
• Stand-alone:
• Mostly maintain personal databases using ready-to-use
packaged applications.
• An example is a tax program user that creates its own
internal database.
• Another example is a user that maintains an address book
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 1- 34
Workers behind the Scene
 DBMS system designers and implementers

Design and implement the DBMS modules and interfaces as
a software package
 Tool developers

Design and implement tools
 Operators and maintenance personnel

Responsible for running and maintenance of hardware and
software environment for database system
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Advantages of Using the DBMS
Approach
 Controlling redundancy in data storage and in development and
maintenance efforts.

Sharing of data among multiple users.

Controlling redundancy
• Data normalization
• De-normalization
• Sometimes necessary to use controlled redundancy to improve the
performance of queries

Restricting unauthorized access to data

Security and authorization subsystem

Privileged software
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Advantages of Using the DBMS
Approach (cont'd.)
 Providing backup and recovery services

Backup and recovery subsystem of the DBMS is
responsible for recovery
 Providing multiple interfaces to different classes of users.

Graphical user interfaces (GUIs)
 Representing complex relationships among data

May include numerous varieties of data that are interrelated
in many ways
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Advantages of Using the DBMS
Approach (cont'd.)
 Enforcing integrity constraints

Referential integrity constraint
• Every section record must be related to a course record

Key or uniqueness constraint
• Every course record must have a unique value for
Course_number

Business rules

Inherent rules of the data model
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Advantages of Using the
Database Approach
 Drawing inferences and actions from the stored data using
deductive and active rules
 Providing persistent storage for program Objects

In Object-oriented DBMSs
 Providing Storage Structures (e.g. indexes) for efficient Query
Processing
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 1- 39
Advantages of Using the DBMS
Approach (cont'd.)
 Providing persistent storage for program
objects

Complex object in C++ can be stored
permanently in an object-oriented DBMS
 Impedance mismatch problem
• Object-oriented database systems typically offer
data structure compatibility
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Advantages of Using the DBMS
Approach (cont'd.)
 Providing storage structures and search
techniques for efficient query processing

Indexes
 Buffering and caching
 Query processing and optimization
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Advantages of Using the DBMS
Approach (cont'd.)
 Permitting inferencing and actions using
rules

Deductive database systems
• Provide capabilities for defining deduction rules
• Inferencing new information from the stored
database facts

Trigger
• Rule activated by updates to the table

Stored procedures
• More involved procedures to enforce rules
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Advantages of Using the DBMS
Approach (cont'd.)
 Additional implications of using the
database approach

Reduced application development time
 Flexibility
 Availability of up-to-date information
 Economies of scale
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
A Brief History of Database
Applications
 Early database applications using
hierarchical and network systems

Large numbers of records of similar structure
 Providing data abstraction and application
flexibility with relational databases

Separates physical storage of data from its
conceptual representation
 Provides a mathematical foundation for data
representation and querying
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
A Brief History of Database
Applications (cont'd.)
 Object-oriented applications and the need
for more complex databases

Used in specialized applications: engineering
design, multimedia publishing, and
manufacturing systems
 Interchanging data on the Web for ecommerce using XML

Extended markup language (XML) primary
standard for interchanging data among various
types of databases and Web pages
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
A Brief History of Database
Applications (cont'd.)
 Extending database capabilities for new
applications

Extensions to better support specialized
requirements for applications
 Enterprise resource planning (ERP)
 Customer relationship management (CRM)
 Databases versus information retrieval

Information retrieval (IR)
• Deals with books, manuscripts, and various forms of
library-based articles
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
When Not to Use a DBMS
 More desirable to use regular files for:

Simple, well-defined database applications not
expected to change at all
 Stringent, real-time requirements that may not
be met because of DBMS overhead
 Embedded systems with limited storage
capacity
 No multiple-user access to data
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Summary
 Database

Collection of related data (recorded facts)
 DBMS

Generalized software package for
implementing and maintaining a computerized
database
 Several categories of database users
 Database applications have evolved

Current trends: IR, Web
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Download