0% found this document useful (0 votes)
24 views

Introduction To Database Systems

This document discusses relational database management systems (RDBMS). It provides an overview of 5 textbook units that cover topics like the entity-relationship model, the relational model and SQL. It also describes the contents of each chapter, including introductions to database systems, data modeling, database design, and transaction management. The document explains that a RDBMS allows for data storage, manipulation, sharing and protection across multiple users through a centralized database.

Uploaded by

soorajkumar2828
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Introduction To Database Systems

This document discusses relational database management systems (RDBMS). It provides an overview of 5 textbook units that cover topics like the entity-relationship model, the relational model and SQL. It also describes the contents of each chapter, including introductions to database systems, data modeling, database design, and transaction management. The document explains that a RDBMS allows for data storage, manipulation, sharing and protection across multiple users through a centralized database.

Uploaded by

soorajkumar2828
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 63

RELATIONAL DATABASE MANAGEMENT SYSTEMS

Text Books :
1. Elmasri and Navathe , Fundamentals of Database
System, 4th edition. (UNITS-1,2,3 and 4)

2 . Raghu Ramakrishnan and Johannes Gehrke, Database


Management System,3rd edition. (UNIT – 5)

Reference Book:
1. Silberschatz , Korth and Sudharshan , Database System
Concepts, 4th edition
Contents
UNIT - I
1. Introduction to database systems
2. Entity – Relationship Model

UNIT - II
3. Relational Model and Relational Algebra

UNIT – III
4. SQL – The Relational Database Standard

UNIT – IV
5. Database Design

UNIT – V
6.Transaciton Management
1.1 Introduction to the
database system
Topics to be discussed

1. Introduction
2. Characteristics of the Database approach
3. Actors on the scene
4. Advantages of using the DBMS approach
5. Data Models
6. Schemas and Instances
7. Three Schema Architecture and Data Independence
1.1 Introduction
-Databases and Database system have become an
essential component of everyday life in our society.

-They play a critical role in almost all the areas


• Business,
• Electronic commerce
• Engineering
• medicine
• Law
• Education etc
1.1 Introduction
• Traditional database applications store most of the
information in the form text or numbers.
Examples : Banking system , hotel reservation system

• Modern database Applications can store other than texts


and numbers :
• Multimedia databases (video and sound)
• Geographic Information System (GIS) (e.g. weather data)
• Data warehouses and Online analytical processing,
• Real time and active database technology

- For controlling industrial and manufacturing processes


What is a Database ?
• A database is a collection of related data.

Data - known facts that can be recorded


- have implicit meaning
Example : A student database with following data.
Name, telephone numbers, place, address

Database Properties :
1. represents some aspects of the real world (mini world ).

2. A logically coherent collection of data with some inherent meaning.

3. Designed , built and populated with data for a specific purpose .

4. It has an intended group of users and some preconceived applications in


which these users are interested.
Database Management System (DBMS)

• A DBMS is a general purpose software system that facilitates the


following process among the various users and application.
1. Defining - Specifying the data types , structures, and constraints.
2. Constructing - The process of storing the data itself on some
media.
3. Manipulating - querying, updating and generating reports.
4. Sharing - Concurrently accessing the database by multiple users
and applications.

- Other functions :
• Protection (system protection and security protection)
• maintaining (allowing the system to evolve)
Database System
• The database and DBMS are together called database system
An Example : A UNIVERSITY database
1.2 Characteristics of Database Approach.
(File processing Vs database Approach)

• In traditional file processing, each user defines and


implements the files needed for a specific software
application as part of programming the application:This
results data redundancy (duplication of same data)
1.2 Characteristics of Database Approach.
(File processing Vs database Approach)

• In the database approach, a single repository of data is


maintained that is defined once and then is accessed by
various users. This minimizes data redundancy.
1.2 Characteristics of Database Approach.

• The main characteristics of the database approach versus


the file-processing approach are the following :

 Self-describing Nature of a Database.


 Insulation between programs and data, and data
abstraction
 Support of multiple views of the data
 Sharing of data and multiuser transaction processing
1.2 Characteristics of Database Approach.

 Self-describing Nature of a Database.

• A database has complete description of the database structure and


constraints. These descriptions are stored in the DBMS catalog.
» The information stored in the catalog is called meta – data.

• The DBMS software makes use of catalog to access any required


data item.
1.2 Characteristics of Database Approach.
Example for DBMS Catalog for UNIVERSTY database
1.2 Characteristics of Database Approach.

 Self-describing Nature of a Database.

• Whereas traditional file processing software can access only specific


databases, DBMS software can access diverse databases.

For example,
– An application program written in c++ may have struct or class
declarations,

– A COBOL program has Data Division statements to define its files


1.2 Characteristics of Database Approach.
 Insulation between Programs and Data, and Data Abstraction :

• program-data independence.
• In Database approach, the structure of the data files is stored in the DBMS
catalog separately from the program access. So changes to data file do not
require the changes to the program. This Property is called program-data
independence.

For Example : Adding another column to student file , say the BirthDate
You just need to change the description of STUDENT records in the
catalog. You need not change the your program
1.2 Characteristics of Database Approach.
 Insulation between Programs and Data, and Data Abstraction :

• Program – operation independence


• In Object oriented and Object –relational system a user program
can operate on data regardless of how these operations are
implemented.

– An operation is specified in two parts.


• The interface  operation name and the data types of its arguments

• The implementation  specified separately and can be changed

without affecting the interface.


1.2 Characteristics of Database Approach.
 Insulation between Programs and Data, and Data Abstraction :

• Data Abstraction

• A characteristics that allows program-data independence and

Program – operation independence is called data abstraction.

• Data abstraction. provides users with a conceptual representation of

data

• Hides the details of how the data is stored or how the operations are

implemented.
1.2 Characteristics of Database Approach.
 Insulation between Programs and Data, and Data Abstraction :

• Data Abstraction

A typical database user is not concerned with the location of each data
item within a record or its length
1.2 Characteristics of Database Approach .
 Support of multiple views of data
• A multi-user DBMS must provide facilities for defining multiple
views for a variety of users.
• A view may be a subset of the database or it may contain virtual
data

The COURSE PREREQUISITES view by one user


1.2 Characteristics of Database Approach .
 Support of multiple views of data

The STUDENT TRANSCRIPT view by another user


1.2 Characteristics of Database Approach .
 Sharing of Data and Multi-user Transaction Processing
• A DBMS allows multiple users to access the database at the same
time.
• A DBMS includes concurrency control software to control several
users trying to update the same data.
• Each transaction must be executed in isolation from other
transaction. (isolation property)
• Either All the operations in a transaction are executes or none
are. (Atomicity property)
1.4 Actors on the Scene

• The People whose jobs involve the day-to-day use of large database.
1. Database Administrators (DBA) :
• Responsible for administering the database and DBMS software .
• Responsible for authorizing access to the database.
• Acquiring software and hardware resources as needed.
• Accountable for problems such as security and poor system response time.

2. Database designers :
• Responsible for identifying the data to be stored in the database
• Choosing appropriate structures to represent and store this data.
• Understanding and collecting user requirements and to come up with desired
design
• Interacting with each potential group of users to develop views of the database.
1.4 Actors on the Scene

• The People whose jobs involve the day-to-day use of large database.
3. End Users : End users access the database for querying , updating and generating
reports.

• Casual End Users :


 Occasionally access the database with sophisticated database query
language.
 They are typically middle or high level managers or other occasional browsers

• Naive or parametric end users


 Constantly querying and updating the database using standard types of
queries and updates called - canned transactions

Examples: Bank tellers, Reservation clerks for airlines and hotels


1.4 Actors on the Scene

• The People whose jobs involve the day-to-day use of large database.
3. End Users : End users access the database for querying , updating and generating
reports.

• Sophisticated end users :


 Include engineers , scientists and business analysts and others who
thoroughly familiarize themselves with the DBMS so as to implement their
applications.

• Stand – alone users


 Maintaining personal databases by using ready made program packages that
provides menu based interfaces.

e.g. the user of a tax package


1.4 Actors on the Scene

• The People whose jobs involve the day-to-day use of large database.
4. Software Engineers (System analysts and Application Programmers)

 System analysts determine the requirement of end users and develop

specification for canned transactions that meet these requirements.

 Application programmers implement theses specifications as

programs .Then they test ,debug , document and maintain these canned

transaction.
1.6 Advantages of using the DBMS Approach

• Following are the advantages of using a DBMS

• Controlling Redundancy
• Restricting Unauthorized access
• Proving Persistent storage for Program objects
• Providing Storage Structures for efficient Query Processing
• Providing backup and Recovery.
• Providing multiple user interfaces
• Representing Complex Relationships among data
• Enforcing Integrity Constraints
• Permitting Interfacing and Actions using rules
• Additional advantages
1.6 Advantages of using the DBMS Approach

1. Controlling Redundancy

• Redundancy means storing the same data multiple times.

Problems of redundancy :

• Leads to Duplication of efforts  entering data -multiple times

• Wastage of storage space  serious problem for large databases

• Inconsistency  Due to abnormal updating

• In the database approach , these redundancy problems can be removed

by storing logical data items in only one place.


1.6 Advantages of using the DBMS Approach

1. Controlling Redundancy

– In some cases controlled redundancy is required for improving the


query performance .
For example : we may store Student-Name and CourseNumber redundantly in a
GRADE_REPORT file to speed up access
1.6 Advantages of using the DBMS Approach

1. Controlling Redundancy

– Inconsistent record.

GRADE_EPORT record that is inconsistent with the STUDENT file which


may be entered erroneously if the redundancy is not controlled.
1.6 Advantages of using the DBMS Approach
2. Restricting Unauthorized Access
• A DBMS allows only authorized users to access the
database to provide the security to the database.
For example: Financial Database
• A DBMS controls type of access operation (retrieve and
update).
• A DBMS provides security and authorization subsystem
for the DBA to create accounts and specify account
restriction.
1.6 Advantages of using the DBMS Approach

3. Providing Persistent Storage for Program Objects.


• An object – oriented DBMS provides persistent storage for program
objects and data structures.

e.g. : C++ and java objects can be stored permanently so that

later they can be read whenever necessary.

• An object – oriented DBMS software automatically performs any


necessary conversions
• Such an object is said to be persistent, since it survives the
termination of program execution.
1.6 Advantages of using the DBMS Approach
4. Providing Storage for Structures for Efficient Query Processing.

• Since database is typically stored on disk , DBMS uses index files to

speed up the searching process to increase the efficiency of query

processing .

• It uses buffering module to maintain the records in the main

memory.

• The query of the DBMS is responsible for choosing an processing

and optimization module efficient query execution plan for each

query based on the existing storage structures.


1.6 Advantages of using the DBMS Approach
5. Providing Backup and Recovery.

• The back up and recovery subsystem of the DBMS is responsible


for recovery.
• It makes sure that the database is restored to the state it was in
before the transaction started executing

6. Providing Multiple User Interface


1. query languages for users
2. APIs (Application Programming Interface) for application programmers
3. Forms and command codes for parametric users.
4. Menu Driven interfaces and natural language for stand-alone programmers
1.6 Advantages of using the DBMS Approach
6. Representing complex Relationship among Data.

• A DBMS must have the capability to represent a variety of complex


relationships among the data as well as to retrieve and update related
data easily and efficiently

Relationships among records of different files


1.6 Advantages of using the DBMS Approach

6. Enforcing Integrity Constraints.


• A DBMS provides capabilities for defining and enforcing Integrity
constraints.
• Integrity Constraints can be :

1. Simple

- data item (coloumn) name must be string

2. complex type

- e.g. a section record must be related to course record.

3. Uniqueness constraints
- Register number of a student must be unique

•Sometimes a data item is entered wrongly , and it still satisfies the


constraints
1.6 Advantages of using the DBMS Approach

Can you identify different constraints in the UNIVERSITY database?


1.6 Advantages of using the DBMS Approach
9. Permitting Inferencing and Actions Using Rules :

• Some database systems provide capabilities for


defining deduction rules for inferencing new
information from the stored database facts. Such
systems are called deductive database systems.
• Active database systems provide active rules that can
automatically initiate actions when certain events and
conditions occur.
1.6 Advantages of using the DBMS Approach

10. Additional advantages :

• Potential for enforcing standards


- permits the DBA to define and enforce standards among database
users
- This facilitates communication and cooperation

• Reduced Application Development Time


- Designing and implementing a new database from scratch may take more

time than writing a single specialized file application.

• Flexibility
- allow certain types of evolutionary changes to the structure of the
database without affecting the stored data and the existing
application programs.
1.6 Advantages of using the DBMS Approach

10. Additional advantages :

• Availability of up-to-Date information.


- As soon as one user's update is applied to the database, all other
users can immediately see this update

• Economics of scale
- permits consolidation of data and applications
- reduces the amount of wasteful overlap between activities of
data processing personnel
- enables the whole organization to invest in more powerful
processors, storage devices, or communication gear
2.1 Data Models , Schemas
and Instances
Data models :

• Data abstraction
– Fundamental characteristic of Database approach
– Provided by hiding the details of data storage.
• A Data Model
– Provides means to achieve this abstraction.
– a collection of concepts that can be used to describe
the structure of database.
Data models :

• Structure of database means:


– the data types of the data
– relationships among the data
– and constraints on the data .
• A data model may also include:
– a set basic operations for retrieval and updates on
the database. (insert ,delete, update)
– A set of valid user defined operation (e.g: Computing GPA
of students)
Categories of Data models :

• Can be categorized based on the types of concepts that


describe the database structure

1. High – level or Conceptual data model


2. Low – level or physical data models
3.Representational (implementation) data models
Categories of Data models :

1. High – level or Conceptual data model :


• Provide concepts that are close to the way many
users perceive data.
• Generally meant for typical end users.
• Uses concepts such as entities, attributes, and
relationships
Categories of Data models :

2. Low – level or physical data models :

• Provide concepts that describe the details of how


data is stored in the computer.
• Specifies record formats, record orderings, and
access paths.
• Generally meant for computer specialists.

• An access path is a structure that makes the search for particular


database records efficient
Categories of Data models :

3. Representational (implementation) data models


• Most frequently used in traditional commercial
DBMSs.
• They are record – based data models:

– represent data by using record structures


• Examples
– Relational data model
– Network data models
– Hierarchical data models
Database Schemas
• It is the description of a database
• It is specified during design of data base.
• A database schema can be displayed as diagrams by using certain
conventions
• Each object in the schema is called schema constructs (student
or course )
• A scheme diagram describes only some aspects of schema such as
• Names of record types

• Data items

• Some constraints
Database Schemas

Example : Schema diagram For the University Database

schema constructs - student, course, prerequisite , section and grade_Report


Database Instances
– The data in the database at a particular moment in time
database state or snapshot or current set of instances or
occurrences .

A database can have many state

A database state of university


database
Database Instances

• Valid database state  A state that satisfies the structure and


constraints specified in the schema
• Meta Data The DBMS catalog that stores description of the
schema constructs and constraints.
• The schema is sometimes called the intension and a database state
an extension
• Schema evolution  changing a schema as the application
requirements changes
– A schema is not supposed to change frequently
2.2 Three Schema
Architecture for databases
2.2 Three Schema Architecture Describes 3 important characteristic of
database approach :
1. Program - data and program – operation independence
2. Support of multiple views
3. Use of catalog to store schema
Schemas can be defined at 3 levels

1. Internal level
 Describes the physical storage of the structure
 Uses physical data model to describe internal schema
 Describes complete details of data storage and access paths for
the database.
2. Conceptual level
 Describes entities , data types , relationships , user operations
and constraints.
 Uses representational data model to describe the conceptual
schema.
 Hides details of physical storage
3. External (view) level
 Describes a part of the database that a particular user group is
interested and hides rest of the database.
 Uses representational model to describe each external schema
2.2 Three Schema Architecture - Example
Conceptual level or Conceptual schema :
Students(sid: string, name: string, login: string, age: integer, gpa:real)
Courses(cid: string, cname:string, credits:integer)
Enrolled(sid:string, cid:string, grade:string)

Internal level or Physical schema :


Relations stored as unordered files.
Index on first column of Students.

External level (different user Views):


Course_info1(cid:string, enrollment:integer)
Course_info2(cid:string, sid:string , grade:string)
Student_info 1(name:string, age: integer)
Student_info 2(name:string, cid:string, grade:string))
Data Independence

• The three-schema architecture can be used to further


explain the concept of data independence
• Data Independence is the Capacity to change the schema at
one level of a data base system without having to change the
schema at the next higher level.
• Two types of Data independence
1. Logical data independence:
2. Physical Data Independence
Logical data independence:
– The Capacity to change conceptual schema without having to
change external or application programs.
– We may change conceptual schema
• to expand database
• to change constraints

• or to reduce the database.

– After changes to conceptual schema the application programs


that reference the external schema construct must work as
before.
 Only view definition and the mapping need to be changed in a DBMS
that supports logical independence.
An Example for Logical data independence:

Consider the UNVERSITY database.


An Example for Logical data independence:

Now suppose that a user is interested in viewing the student details


consisting of course number , grade, semester , year and sectionId
. So he issues a query , say Q1, and gets the following external
view (schema)
An Example for Logical data independence:

Now suppose that the conceptual schema for GRADE_REPORT is


changed to include StudentName and CourseNumber.
An Example for Logical data independence:

Now, If the user is again interested in viewing the same Student


Transcript by the issuing the same query (Q1) , then he must get the
same External view which he obtained before changing the conceptual
schema
2. Physical data independence:

 The Capacity to change internal schema without having to change the


conceptual schema.
 Hence, the external schemas need not be changed as well.
 Changes may be needed because some physical files had to be
reorganized to improve the performance of retrieval and updates.
 If the same files remains as before then we should not have to change
the conceptual schema.

You might also like