Subject Name: Database Management Systems Subject Code: 10CS54 Prepared By: Sindhuja K Department: CSE Date
Subject Name: Database Management Systems Subject Code: 10CS54 Prepared By: Sindhuja K Department: CSE Date
1
10CS54
DATABASE MANAGEMENT
SYSTEMS
2
Elmasri and Navathe: Fundamentals of Database Systems, 5th Edition, Pearson
Education, 2007 (Chapters 1, 2, 3 except 3.8, 5, 6.1 to
6.5, 7.1, 8, 9.1, 9.2 except SQLJ, 9.4, 10)
Raghu Ramakrishnan and Johannes Gehrke: Database Management Systems, 3rd
Edition, McGraw-Hill, 2003. (Chapters 16, 17.1,
17.2, 18)
Reference Books:
Silberschatz, Korth and Sudharshan: Database System
Concepts, 6th Edition, Mc-GrawHill, 2010.
C.J. Date, A. Kannan, S. Swamynatham: An Introduction to Database Systems,
8th Edition, Pearson Education, 2006
Engineered for Tomorrow
3
Engineered for Tomorrow
Objective
• The objective of this course is to prepare students to design and
implement database information systems. It teaches the
students a three-stage methodology for designing relational
database applications, namely, conceptual, logical, and physical
database modeling and design.
• In the first stage students will build a conceptual data model
(ER-Diagram) that is independent of all physical
considerations then to transform this model in the second stage
into the logical model (Relational database). Also students will
translate the logical data model into a physical design (SQL
Queries) for the target DBMS.
4
Engineered for Tomorrow
Course Topics
UNIT 1 - Introduction
UNIT 2 - Entity-Relationship Model
UNIT 3 - Relational Model and Relational Algebra
UNIT 4 - SQL – 1
UNIT 5 - SQL – 2
UNIT 6 - Database Design -1
UNIT 7 - Database Design - 2
UNIT 8 - Transaction Management
5
Unit –I
INTRODUCTION
Engineered for Tomorrow
6
Engineered for Tomorrow
Unit 1- TOPICS
• Introduction, An example
• Characteristics of Database approach
• Users- Actors on the screen, Workers behind the scene
• Advantages of using DBMS approach
• A brief history of database applications, when not to use a
DBMS.
• Data models, schemas and instances
• Three-schema architecture and data independence
• Database languages and interfaces
• The database system environment
• Centralized and client-server architectures
• Classification of Database Management systems. 7
Engineered for Tomorrow
Learning Outcomes
• Students will be able to understand the Database System
Environment in detail with its users, characteristics and
advantages.
• Also the data basic terminologies like data models, schemas and
instances are exposed in this unit .
• Will known about the types of database systems based on their
distribution.
8
Engineered for Tomorrow
9
Engineered for Tomorrow
1. INTRODUCTION
• Early days database - File systems
• Drawbacks:
• Data redundancy
• Multiple file formats, duplication of information in different files
• No data recovery
• No backup of data
• Inconsistent data
• Multiple file updation
• Limited data sharing and excessive program
maintenance
• Hard to add new constraints or change existing ones
10
Engineered for Tomorrow
12
Engineered for Tomorrow
13
Engineered for Tomorrow
14
Engineered for Tomorrow
• Other features:
– Protection or Security measures to prevent
unauthorized access
– “Active” processing to take internal actions on
data
– Presentation and Visualization of data
– Maintaining the database and associated programs
over the lifetime of the database application
• Called database, software, and system maintenance
15
Engineered for Tomorrow
2. Example
• Mini-world for the example: Part of a UNIVERSITY environment.
• Some mini-world entities:
– STUDENTs
– COURSEs
– SECTIONs (of COURSEs)
– (academic) DEPARTMENTs
– INSTRUCTORs
• Some relationships:
– SECTIONs are of specific COURSEs
– STUDENTs take SECTIONs
– COURSEs have prerequisite COURSEs
– INSTRUCTORs teach SECTIONs
– COURSEs are offered by DEPARTMENTs
– STUDENTs major in DEPARTMENTs
16
Engineered for Tomorrow
17
Engineered for Tomorrow
18
Engineered for Tomorrow
19
Engineered for Tomorrow
20
Engineered for Tomorrow
Database catalog
21
Engineered for Tomorrow
• Data Abstraction:
– 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
• 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.
• Sharing of data and multi-user transaction processing:
– Allowing a set of concurrent users to retrieve from and to update the database.
– Concurrency control within the DBMS guarantees that each transaction is
correctly executed or aborted
– Recovery subsystem ensures each completed transaction has its effect
permanently recorded in the database
– OLTP (Online Transaction Processing) is a major part of database applications.
This allows hundreds of concurrent transactions to execute per second.
22
Engineered for Tomorrow
4. Database Users
• Users may be divided into
– Use and control the database content, and those
who design, develop and maintain database
applications (called “Actors on the Scene”).
– Design and develop the DBMS software and
related tools, and the computer systems operators
(called “Workers Behind the Scene”).
23
Engineered for Tomorrow
24
Engineered for Tomorrow
25
Engineered for Tomorrow
• Others
– Enforce standards
• Flexibility to change data structures:
– Database structure may evolve as new requirements are defined.
• Availability of current information:
– Extremely important for on-line transaction systems such as airline,
hotel, car reservations.
• Economies of scale:
– Wasteful overlap of resources and personnel can be avoided by
consolidating data and applications across departments.
27
Engineered for Tomorrow
28
Engineered for Tomorrow
8. Data Models
• Data Model:
– A set of concepts to describe the structure of a database, the operations for
manipulating these structures, and certain constraints that the database should
obey.
• Data Model Structure and Constraints:
– Constructs are used to define the database structure
– Constructs typically include elements (and their data types) as well as groups
of elements (e.g entity, record, table), and relationships among such groups
– Constraints specify some restrictions on valid data; these constraints must be
enforced at all times
• Data Model Operations:
– These operations are used for specifying database retrievals and updates by
referring to the constructs of the data model.
– Operations on the data model may include basic model operations (e.g. generic
insert, delete, update) and user-defined operations (e.g. compute_student_gpa,
update_inventory)
31
Engineered for Tomorrow
32
Engineered for Tomorrow
Database Schema
35
Engineered for Tomorrow
9. Three-Schema Architecture
• Proposed to support DBMS characteristics of:
– Program-data independence.
– Support of multiple views of the data.
• Not explicitly used in commercial DBMS
products, but has been useful in explaining
database system organization
36
Engineered for Tomorrow
37
Engineered for Tomorrow
38
Engineered for Tomorrow
39
Engineered for Tomorrow
41
Engineered for Tomorrow
42
Engineered for Tomorrow
43
Engineered for Tomorrow
44
Engineered for Tomorrow
45
Engineered for Tomorrow
46
Engineered for Tomorrow
• Application programmer
– Writes programs in host languages.
– The precompiler separates the DML command and the host program.
– DML commands are submitted to the DML compiler and the rest of the
program to the host compiler.
– The outputs of DML compiler and host compiler are linked by the compiled
transaction to form the executable codes which includes the calls to the runtime
database processor.
• Parametric users
– Supply the parameters (eg. account number and amount for bank withdrawal)
using the compiled transactions.
• The privileged commands, executable query plan and the
compiled transactions with the runtime parameters are
executed by the runtime database processor. It refers the
data dictionary for updations.
47
Engineered for Tomorrow
• LOWER module
– Stored data manager carry out the input and output
operations between the disk and main memory and
provides support for database management including
management of access paths and indexes.
– The file manager deals with the data structure options for
storing in the database and maintains the metadata as well
as indexes for various files.
– The interfacing between the main memory and disk is
handled by the buffer manager.
– The transaction manager is responsible for concurrency
and crash recovery by maintaining a record of all changes
to the database.
48
Engineered for Tomorrow
12.DBMS Architecture
• 12.1 Centralized DBMS
– In a centralized database system the DBMS functionalities,
application programs, and user interface are carried out on a
single/centralized system. User can connect through a remote
terminal which is connected to central computer.
Terminal 1
Terminal 2
Centralized System
Terminal 3
SOFTWARE
Centralized
Database
Terminal n
HARDWARE/FIRMWARE
51
Engineered for Tomorrow
Network
Site 1 CLIENT
Site n
USER Application CLIENT &
SERVER
Communicatio
Site 2 SERVERS n Network
USER
Application
53
Engineered for Tomorrow
54
Engineered for Tomorrow
55
Engineered for Tomorrow
56
Engineered for Tomorrow
57
Engineered for Tomorrow
Summary
• Types of Databases and Database Applications
• Basic Definitions
• Typical DBMS Functionality
• Example of a Database (UNIVERSITY)
• Main Characteristics of the Database Approach
• Database Users
• Advantages of Using the Database Approach
• When Not to Use Databases
• Data Models and Their Categories
• History of Data Models
• Schemas, Instances, and States
• Three-Schema Architecture
• Data Independence
• DBMS Languages and Interfaces
• Database System Utilities and Tools
• Centralized and Client-Server Architectures
• Classification of DBMSs
58