Database Management Systems

Developed By SMS (The best friends group) 1
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

DATABASE MANAGEMENT SYSTEMS

UNIT – I
Operational data, Purpose of database system, Views of data, Data models: Relational, Network,
Hierarchical, Instances & Schemes, Data Dictionary, Types of Database languages: DDL, DML,
Structures of a DBMS, Advantages & Disadvantages of a DBMS, 3- Level Architecture Proposal:
External, Conceptual & Internal Levels, Entity Relationship Model as a tool of conceptual & Internal
Levels, Entity Relationship Model as a tool of conceptual set, Attributes, Mapping Constraints, Keys,
Entity-Relationship diagram (E-R diagram) : Strong & weak entities, Generalization, Specialization,
Aggregation, Reducing ER diagram to tables

UNIT – II
Set theory concepts and fundamentals: Relations, Domains, Attributes, Tuple, Concepts of Keys:
Candidate key, Primary Key, Alternate Key, Super Key, Foreign Key, Fundamental integrity rules:
Entity integrity, Referential integrity, Extension & Intention, Relational Algebra : Select, Project, Cross
product, Different types of joins i.e. theta join, equi join, natural join, outer join, set operations. Structure
query language (SQL), Codd's rules.

UNIT – III
Functional Dependencies, Good & Bad Decomposition, Anomalies as a database: A consequences of
bad design, Universal Relation, Normalization: First, Second, Third & BCNF Normal Forms,
Multivalues Dependency, Join Dependency & forth Fifth Normal Form.

UNIT – IV
Basic Concepts – INDEXING & HASHING, Indexing: B+ tree Index Files, B-tree Index Files, Hashing
: Static has functions, Dynamic Hash Functions, Index Definition in SQL : Multiple key Access.

UNIT – V
Failure Classification, The Storage Hierarchy, Transaction Model, Log Based Recovery, Buffer
Management, Shadow Paging
Database Management Systems
Developed By SMS (The best friends group) 2
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
Bachelor of Computer Application (BCA) Examination, December 2005
2BCA3 - DATA BASE MANAGEMENT SYSTEM
Unit I
1. ril-¤-¬ ¬i ¤¬ E-R -i·¬ (·i:¤ l¬¬- ·i·-º ¬ini ¬i ¤¬ ¬- ·¤¤ ri ¬i º ºiln¤i ¬i ¤¬ ¬- ·¤¤ ri ¤-¤¬ ºini
¬i --- ºini ¬ ¬i·i Association (’ii:¤+
Draw an E-R diagram for the database of hospital with a seat of patients and set of a Medical
Doctors with each patients a log of the various tests conducted is also associated. 20
2. (¬) Recursive ¬-(··i ¬i ·¤i -n¬( r ` ¬ s ¬(irººi (¬º ¬-ni:¤+
What is meant by a Recursive relationship type? Give some examples of recursive relationship types. 10
(() (i Record based ·i-i -i·¬ ¬ ¬i·i ( ril· ¬i ¤lº¬l·in ¬il¬¤+
State the major advantage and disadvantage of the two record base data models. 10
Unit II
3. l·-· ¬i ·¤iª¤i ¬il¬¤
(¬) ¬ ¤º ¬i (() ¤i·il-¬ ¬i (¬) lº¬’i· ¤¬¬(i - ¬i¬ ¤i··- (() ¤ i¬·- ¬i¤º’i·+
Describe the following:
(a) Super Key (b) Primary Ke (c) Cross Product in Relational Algebra (d) Project Operation. 20
4. ¤¬. ·¤. ¤¬. ¬ ¬i¤ ·¤i ¬-nn ri ` ¬(irººi ¬lrn SQL ¬i ·¤iª¤i ¬il¬¤+
What do you mean by S.Q.L.? Describe the SQL with example. 20
Unit III
5. l·-·l¬lªin ¬i ·¤iª¤i ¬il¬¤ Explain the following:
(a) Tuple Entity (b) Normalization
(c) Codd Rule (d) Universal Relation. 20
6. (¬) ¤i ·i (4 NF) ¬i º ¤i¤( (5 NF) - ¬i ·÷¬i · ¬ ¤i¬ ¬i-· r `
What are common factor in fourth and fifth normal form? 10
(() l·-· Relation riºi ¬n ·- ¬i ¬i· (i¬i ¬·ii Functional dependencies (ni:¤
List all functional dependencies satisfied by the following relation:
A B C
a
1
a1
a
2

a
2

b
1

b
1

b
1

b
1

c
1

c
2

c
1

c
2

Unit IV
7. B
+
-i ¤º ¬(irººi ¬lrn ¤¬ l·(··i l¬lªi¤+
Write an essay on B
+
tree with suitable example. 20
8. B- -i :···¬ ¤i:¬ ·¤i r ` ¬(irººi ¬lrn ·i:·il-¬ r ¬ ¤·’i· ¬i ·¤iª¤i ¬il¬¤+
What is B-tree index files? Describe Dynamic Hash Function with an example. 20
Unit V
9. (¬) Buffer Management ·¤i r `
What is Buffer Management?
(() l·-¬ ªiºi( ri· ¬ ¬¤ºi·n ¬i: Recovery Procedure (ni:¤+
Explain a recovery procedure that is needed after a disk crash. 10
10. (¬) ·i-i(¬ ¬ Transaction Model ¬i ·¤iª¤i ¬il¬¤+
Describe the Transaction Model of Database. 10
(() Failure Classification ¬ ¬ s -r-(¤ºi ¤r¬¬i ¬i ·¤iª¤i ¬il¬¤+
Describe some important features of failure classification. 10

Database Management Systems
Developed By SMS (The best friends group) 3
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
Database Mangement system Interelated Data n·ii ¬¬ Data ¬i Access ¬º· ¬ l¬¤ l¬ªi n¤ Programs ¬i
¬-r r l¬¬i ·ii ¤¬ Enterprise ¬ Related Data ¬ collection ¬i Database ¬ri ¬ini r+ DBMS ¬i ¤ - ªi
¬( (º¤ Database Information ¬i ¬ri n·ii Convenient ª¤ ¬ Store ¬º·i r+

Database System Application: - Database ¬: ¬nr ¤º ¤ ¤in - ¬i ¬ini r+ ¬n ¬¬¬ l·-· Application r+
(1) Banking ¬ l¬¤ Use ¬i ¬ini r+
(2) Airline Reservation n·ii Information ¬i Schedule (·i· ¬ l¬¤+
(3) Universities - Students ¬ Information n·ii course ¬ (iº - ¤ºi ¬i·¬iºi (· ¬ l¬¤+
(4) Monthly Satement ¬i (·i· ¬ l¬¤+
(5) Telecommunication ¬ l¬¤+
(6) Finance - Sales n·ii Purchase ¬i Information ¬i Store ¬º·i+
(7) Sales - Customer Product ( Purchase Information ¬i ºªi·i+
(8) Manufacturing - Management ¬ Supply n·ii Warehouse ( Order ¬i Information ¬i Store ¬º·i+
(9) Human Resources ¬ ¬·nn n Employee, salary, payroll, tax ¬il( Information ¬i Store ¬º·i+

Database System Vs File System: - File System - Data ¬i Store ¬º¬ Operating System ¤º Store l¬¤i
¬ini r+ System Permanent Records ¬i ¬: Files - ºªin r n·ii l¬¬i File ¬ Record ¤ i·n ¬º·i n·ii ·¤ record
¬i ¬i·· ¬ l¬¤ ¬¬n÷¬¬n ¤ ¬iº ¬ Application Program ¬i Use ¬º·i ¤·ni r+ DBMS ¬ ¤r¬ Systems :¬i
¤ ¬iº ¬i files - Data ¬i Store ¬º¬ ºªin ·i ¤º·n DBMS riºi file system ¬ Disadvantages ¬i (º l¬¤i n¤i (
¤ri DBMS ¬ Advantage rin r +

(1)Data Reduandancy ¬ ¬iººi ¬l·i¬ Storage ( ¬l·i¬ Access Cost ¬nni r + Same Data ¬i Various Copies
¬i ºªi· ¬ ¤¬ ¬-¤ - ¬·ii ¬i ¤¬ ¬i·i Update ·ri l¬¤i ¬i ¬¬ni+ :¬i ¬--¤i ¬i Data Inconsistency ¬ri ¬ini
r+
(2) Difficulting in Accessing Data:- Data ¬i Access ( Retrieve ¬º· - ¬l-·i: · ri :¬¬ l¬¤ l(l·i··
Application Programs ¬i ¬¤¤in - l¬¤i ¬ini r+
(3) Data Isolation:- Data ( Processor ¬i ¤¬ ¬i·i ºªi· ¬ Application Programs ¬ riºi ¬i¬i·i ¬ Data ¬i
Access l¬¤i ¬i ¬¬ni r+
(4) Integrity Problem:- Data ¬i ¬ s Condition ¬ ¬i·iiº ¤º ¤¬ ¬i·i DBMS - ºªii ¬ini r+
(5) Atomicity Problem:- Computer System Mechanical ( Electrical ri· ¬ ¬iººi Faliure Occur ri ¬¬ni
r+ ¤l( Faliure Occur ri ¬i¤ ni ·i-i ¬i ·i-i(¬ Restore ¬º·i ¬i(’¤¬ rini r+ :¬ ri Atomicity ¬ri ¬ini r+
(6) Security:- rº User Database ¬ ·i-i ¬i Access ·ri ¬º ¬¬ni r+ l¬¤ ·i-i(¬ ¬ ¤¬ ¤i- ¬i Access l¬¤i
¬i ¬¬ni r +
View of Data:- Database ¬i ¤¬ ¬·¤ Users ¬i ·i-i ¬i Abstract View Provide ¬º·i r :¬- system ¬i
Details ¬i Hide l¬¤i ¬ini r+ l¬¬¬ ·i-i ¬i l¬¬ nºr Store ( Maintain l¬¤i ¬i¤ ·ii ¤lº·iil·in l¬¤i ¬ini r+
Data Abstraction:- ¬n ·i-i ¬i ¬l·i·ni¬ººi ri ·i-i Abstraction ¬r¬ini r+ Database Users Computer
Trained ·ri rin+ ¬n Developers ¬ riºi ·i-i(¬ ¬i ¬l-¬ni ¬i Users ¬ ¬º l(¤i ¬ini r+ ¬n ¬l·i·ni¬ººi ¬
l·-· Level ¬i define l¬¤i n¤i r+
(1) Physical Level:- ¤r Abstraction ¬i ¬(¬ Lower Level r ¬i ¤r ¤lº·iil·in ¬ºni r l¬ ·i-i ¬i (i-n( -
l¬¬ ¤ ¬iº --iº l¬¤i ¬i¤+ Physical Level Data Structure Detail ¬i ¬l-¬ni ¬i ¤lº·iil·in ¬ºni r +
(2) Logical Level:- Abstraction ¬i ¬n¬i level ¤r ¤lº·iil·in ¬ºni r l¬ Database - ·¤i Data Store ¬º·i
r n·ii ·i-i ¬ (i¤ ¬ Relationship ¬i Maintain ¬º·i+
(3) View Level:- ¤r Abstraction ¬i ¬(¬ ¬¤ºi ¬(¬ r ¬i l¬¤ Part of the Database ¬i ¤lº·iil·in ¬ºni r+



Database Management Systems
Developed By SMS (The best friends group) 4
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945







Instances & Schema:- Information ¬i (r Collection l¬¬ l¬¬i ·iºi ·i-i(¬ - --iº l¬¤i ¬ini r ¬¬
Database Instance ¬rn r +
·i-i(¬ ¬i ¤ºi Design ¬i ·i-i(¬ Schema ¬ri ¬ini r+
Schema ¬i Abstraction Levels ¬ ¬i·iiº ¤º (i-i n¤i r÷
(1) Physical Schema:- ¤r Physical Level ¬i ·i-i(¬ design ¬i ¤lº·iil·in ¬ºni r+
(2) Logical Level Schema:- :¬- Logical Level ¬i l·¬i:· ¬i ¤lº·iil·in l¬¤i ¬ini r+
View Level ¤º ·ii ·i-i(¬ ¬ (r n ¬ Define l¬¤i ¬ini r l¬¬ Subschema ¬rn r+ l¬¬- Database ¬
Different Views ¬i define l¬¤i n¤i r+
Data Models:- Database Structure ri Data Model r+ Data - ¬(·i Consistency Constraint ( ·i-i ¬
¬i~¤l·¬ Tools ¬i ¤lº·iil·in ¬º·i ri Data Models ¬ - ª¤ ¬i¤ r+ l·-· Data Models ¬i define l¬¤i n¤i r÷
(1) E-R Models
(2) Relational Model
(3) Object Oriented Data Model
(4) Object Relational Data Model
(5) Network Data Model
(6) Hierarchical Data Model
(1) E-R Model:- ( Real World Objects l¬·r ¬·¤ Objects ¬ differentiate l¬¤i ¬i ¬¬ni r ¬·r Entity ¬rn
r+ Entities ¬i Attributes ¬ -¤ - Database - ¤lº·iil·in l¬¤i ¬ini r + ¬ ¬ A/c Number, A/c Balance ¬il(
Attributes r l¬¬ Account Entity - define l¬¤i n¤i r+
l(l·i·· Entities ¬ -·¤ ¬(·i -·iil¤n ¬º·i ri Relationship ¬r¬ini r + Database ¬ Logical Structure ¬i E-R
diagram ¬ riºi ¤lº·iil·in l¬¤i n¤i r÷
(1) Rectangles ( )- Entity Set ¬i ¤ (l’i n l¬¤i ¬ini r+
(2) Ellipse ( ) – :¬- Attributes ¬i ¤ (l’i n l¬¤i ¬ini r+
(3) Diamonds ( ):- :¬¬ riºi Entity Set ¬ -·¤ Relationship ¬i ¬- l¬¤i ¬ini r+
(4) Lines (-):- Entity Set ( Entity ¬i ¬i·· ¬ l¬¤ Lines ¬i ¬¤¤in - l¬¤i ¬ini r+









E-R Model - l·-· Attributes ¬i ¤lº·iil·in l¬¤i n¤i r÷
(1) Simple Value Attribute
(2) Compsite Value Attribute
(3) Single Value Attribute
(4) Derived Attribute


View1 View2 ViewN
View level
Logic level
Cust-ID
Customer name Customer Street
Customer City
Customer

Depositor
Account
Account
Number
Balance
Database Management Systems
Developed By SMS (The best friends group) 5
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

(1) Simple Attributes:- Simple Attributes ¬i Parts (¬·¤ ·iini) - l(l·i·· ·ri l¬¤i ¬i ¬¬ni+
Example:- Loan Number, Amount ¬il(+

(2) Composite Value Attributes:- Composite Attributes ( Attributes r l¬·r Sbparts - Devide (l(·i·n) l¬¤i
¬i ¬¬ni r + ¬ ¬÷ Name ¤¬ Composite Attribute r ¬ ¬÷ First name, Middle Name ( Cost Name ¬il(+

(3) Single Value Attribute:- ¤ Attributes l¬·¬i Value r-’ii ¤¬ ri ºrni r ¬ ¬÷ ¤¬ Customer ¤l( (r n ¬
¬i· ¬ni r ni Loan No. r-’ii ¬¬n÷¬¬n rin+ ¬n ¤r ¤¬ Single Value Attribute r+

(4) Multi valued Attribute:- ¬( l¬¬i Attribute ¬i ¤¬ ¬ ·¤i(i Values ri ni ¬¬ Multivalue Attribute ¬ri
¬ini r+ ¬ ¬÷ Phone Number Multi value Attribute r ·¤il¬ ¤¬ Customer ¬ ¤¬ ¬ ·¤(i (0,1,2,………n)
Phone Numbers ri ¬¬n r+

(5) Derived Attribute:- :¬ ¤ ¬iº ¬ Attributes ¬i l(l·i·· ¬·¤ Attributes ¬ Derive l¬¤i n¤i r + ¬ ¬ ¤l( ¤¬
Customer · (r n ¬ ¬i· ¬ ºªi r ni (r ¤ni ¬ni¤i ¬i ¬¬ni r l¬ Customer · Bank ¬ l¬n·i ¬i· l¬¤i r +

Relationship & Relationship Set:- l(l·i·· Entities ¬ -·¤ ¬(·i -·iil¤n ¬º·i ri Relationship ¬r¬ini r+ ¬ ¬
Customer Table ¬i ¬i· -(¬ ¬ ¬(l·in ri·i+
Same Type ¬ Relations ¬i ¤¬ ¬i·i ¤¬l¤n ¬º ºªi·i ri Relationship Set ¬r¬ini r ¬ ¬ (i Entity Set
Customer ( ¬i· ¬ -·¤ Borrower Relationship r ¬i Customer ( ¬i· ¬ -·¤ Relationship ¬i ¤ (l’i n ¬ºni
r+
l¬¬i ·ii Entity Set ¬i Primary Key ¬ riºi l(l·i·· Entity Set ¬i ¬·¤ Entity Set ¬ ¤ ·i¬ l¬¤i ¬i ¬¬ni r +
(2) Relational Model ¼fjys’kuy ekWMy½:- Relational Model Tables ¬i Collection r l¬¬- Data n·ii
Relationship ¬i ¤ (l’i n l¬¤i ¬ini r+ rº -(¬ - Multiple Columns n·ii rº Column ¬i ¤¬ ¬¬n ·i- rini r+
Relational Model ¬i Record Based Model ¬i ¤¬ ¬(irººi ·ii -i·i ¬ini r ·¤il¬ :¬- Records ¬i Fixed
Format - --iº l¬¤i ¬ini r+
Relational Model ¬i abstraction level E-R Model ¬i ¬¤·ii Lower rini r + Database ¬i ¤r¬ E-R Model ¬
ª¤ - Design l¬¤i ¬ini r+ (i( - ¬¬ Relational Model - Translate ¬º l(¤i ¬ini r+
(3) Object Oriented Data Model:- :¬ E-R Model ¬i Extension ·ii ¬ri ¬ini r l¬¬- Encapsulation (¬·ii
·i-i ¬i Related ri ¬i ¤¬ ¬i·i ºªi·i) Methods (l¬¬¬ Database ¬ ·i-i ¬i Access l¬¤i ¬i ¬¬) ( Object
Identity (Object ¬i ¤r¤i·) ¬i ¤lº·iil·in l¬¤i ¬ini r+
E-R Model ¬i ¤¬ Entity ¬i Object ¬ri ¬ini r+ ¬( ·i-i n·ii ¬¬ Access ¬º· ¬ Methods ¬i ¤¬ ¬i·i
Single Unit - ºªii ¬ini r ni :¬ Object Oriented Model ¬i ¤¬ Property Encapsulation ¬ri ¬ini r+ l¬¬¬
Contents ¬i (irºi n-(i riºi ·ri (ªii ¬i ¬¬ni+
(4) Object Relational Data Model:- Object Relational Data Model - Object Oriented Data Model (
Relational Data Model (i ·i ¬i ºiil-¬ l¬¤i ¬ini r+
Data Dictionary:- Data Dictionary - Meta data (Data About Data) ¬i ºªii ¬ini r+ Table ¬i Design
Metadata ¬i ri ¤¬ ¬(irººi r+ Data Dictionary - l·-· Information ¬i --iº l¬¤i ¬ini r+
(1) Name of the Relation (Relation ¬i ·i-)
(2) Names of the Attributes of Each Relation (Relation ¬ rº Attributes ¬i ·i-)
(3) Length of Attributes (Attribute ¬i ¬-(i: )
(4) Integrity Constraints (·-i ¬i ¤¬ ¬i·i ºªi· ¬ l¬¤ ¬¤¬··i ºin ) (r n ¬ ¬i--- - User ¬ ¬(·iin ·i-i ¬i
·ii --iº l¬¤i ¬ini r ¬ ¬÷
(1) Name of The Authorized User
(2) User ¬ ¬(·iin Accounts ¬i ¬¤·i
Database Management Systems
Developed By SMS (The best friends group) 6
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
(3) Password ¤i ¬·¤ ¬¤·i¤+
Database Languages:- Database ¬ riºi l·-· (i ·ii·ii¬i ¬i ¤ ¤in - l¬¤i ¬ini r ÷
(1) DDL:- Database Design ( ¬¬¬ ¬(·iin l(l·i·· ¤lº·ii·ii¬i ¬ ¬n r ¬i ¤¬ Special ·ii·ii ¬ riºi ¤ (l’i n l¬¤i
¬ini r l¬¬ DDl ¬rn r+
¬(iºrºi ¬ l¬¤÷ Create Table Account
(a/c_number valchar(20), balance number (4)
¬¤ºi·n Statement ¬ riºi a/c Table ¬i Create l¬¤i n¤i r+ :¬¬ (DDl) riºi Data dicitionary ¬i ·ii Update
l¬¤i ¬i ¬¬ni r +
¬( l¬¬i ·ii ·i-i ¬i Read ¤i Modify ¬º·i ri ni Database System ¬(¬ ¤r¬ Data Dictionary ¬i ¤ ¬ ¬ºni r+
·i-i(¬ ¬i Storage Structure ( Access Method ¬i ¤¬ Special DDL - ºªii ¬ini r l¬¬ Data Storage and
definition Language (DSDL) ¬ri ¬ini r ¤ Information User ¬ s ¤i ºrni r +
Data Manipulation Language (DML):- Data Manipulation ¬i ¬·i r÷

(1) Database - Store Information ¬i Access ¬º·i+
(2) ·¤i Information ¬i ·i-i(¬ ¬i --iº ¬º·i+
(3) ·i-i(¬ ¬i ¬¤l-·in Information ¬i Delete ¬º·i+
(4) Database - ¬¤l-·in Information ¬i Modify ¬º·i+
DML ¬i - ª¤n (i ·iini - (i-i n¤i r ÷
(1) Procedural DML
(2) Declaration DML

(1) Procedural DML ¬i ¬i(’¤¬ni user ¬i :¬l¬¤ rini r ·¤il¬ ¤r user ¬i l¬¬i Data ¬i ¬i(’¤¬ni r ( ¬¬
·i-i ¬i ¬ ¬ Access l¬¤i ¬i ¬¬ni r + ¬ (iº - (nini r+
(2) Declaration DML:- ¬¬ Non Procedural DML ·ii ¬ri ¬ini r ·¤il¬ :¬- l¬¤ ·i-i ¬i ¬i(’¤¬ni ¬i
¤ (l’i n l¬¤i ¬ini r ¤º·n ¤r define ·ri l¬¤i ¬ini l¬ ·i-i ¬i l¬¬ ¤ ¬iº Access l¬¤i ¬i¤+ Database ¬i
Information ¬i Access ¬º· ¬ l¬¤ Query ¬i ¬¤¤in - l¬¤i ¬ini r+ DML ¬i (r ·iin ¬i ¬¤·i ¬i
Relational ¬ l¬¤ ¬¤¤in - l¬¤i ¬ini r ¬¬ Query Language ¬ri ¬ini r+

Database System Structure:- Database System ¬i Modules - l(·iil¬n l¬¤i n¤i r n·ii rº Module ¤º
System Control ¬ ¬(·iin l¬--(iºi rini r+ Database System ¬i Functionally (i ·iini - l(·iil¬n l¬¤i n¤i r÷
(1) Storage Manager
(2) Query Processor Components
(1) Storage Manager:- Storage Manager Program ¬i (r Module r ¬i Low Level Data n·ii Application
Programs ( Queries ¬ -·¤ Interaction ¬ºni r + Storage Manager File System Commands - ¤lº(lnn
¬º· ¬i ¬i¤ ·ii ¬ºni r+ ¬n Storage Manager Data ¬ Relational ( Updation ¬ l¬¤ ¬-iº(i¤i rini r +
Storage Manager - l·-· n-(i ¬i ºiil-¬ l¬¤i ¬ini r÷
(1) Authorization and Integrity Manager:- :¬- ·i-i ¬ Integrity Constraints n·ii Users ¬i Authority
¬i ·ii ¤ ¬ l¬¤i ¬ini r+
(2) Transaction Manger:- ¤r Database ¬i Ensistancy ¬ l¬¤ ¬-iº(i¤i rini r n·ii Transaction ¬i ¬niniº
l(·i ·¤(·ii· Execute ¬º· ¬i ¬i¤ ·ii ¬ºni r+
(3) File Manager:- :¬¬ riºi Disk Space ( ·i-i Structure ¬i ¤ (l’i n l¬¤i ¬ini r+
(4) Buffer Manager:- Data ¬i Main Memory - ¬i· ¬ l¬¤ ¬-iº(i¤i rini r+
Storage Manager ¬ riºi l(l·i·· Data Structure ¬i Implement l¬¤i ¬ini r÷
(1) Data files:- l¬¬- Data Store ºrni r+
(2) Data Dictionary:- l¬¬- Data About Data ¬i ºªii ¬ini r+
(3) Indices:- :¬- ·i-i ¬i Fast Access l¬¤i ¬i ¬¬ni r +
Database Management Systems
Developed By SMS (The best friends group) 7
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
(2) Query Processor:- Query Processor Components ¬i Include l¬¤i n¤i r ÷
(1) DDL Interpreter:- ¬i DDL Statement ¬i Interpreter ¬ºni r n·ii ¬· Statement ¬i ¤ºi·ii·ii ¬i Data
Dictionary - Store ¼ni r+
(2) DMl Compiler:- ¤r DML Statements ¬i Low-level Instruction - ¤lº(ln n ¬º· ¬i ¬i¤ ¬ºni r +
(3) Query Evaluation Engine:- ¤r DML Compiler riºi Generated Low-Level Instruction ¬i Execute
¬º· ¬i ¬i¤ ¬ºni r+

































Application Architecture:- Database Applications ¬i (i ·iini - l(·i·n l¬¤i n¤i r÷
(1) Two Tier Architecture
(2) Three Tier Architecture
(1) Two Tier Architecture:- :¬- Application ¬i Component - (i-i ¬ini r l¬¬ Client Machine ¤º ºªii
¬ini r + :¬ Component riºi Database System ¬i Functionality ¬i Server Machine ¤º Query Language ¬i
¬ri¤ni ¬ Access l¬¤i ¬ini r+ Client ( Server ¬ -·¤ Interactoin ¬i ¬i¤ ODBC (Open Database
Connectivity) ¤i JDBC (JAVA Database Connectivity) riºi l¬¤i ¬ini r+
Native
/naiveUs
ers
Application
Programmer
Sophisticated
Users
Database
Aministrator
Application
Interface
Application
Programs
Query
Tools
Administrator
Tools
Use Write Use Use
Compiler &
Linker
DML
Queries
DDL Interpreter
Application
Program
Object Code
DML Compiler
& Organizer
Query Evaluation
Engine
Query Processor
Buffer
Manager
File
Manager
Authorization
Integrity
Manager
Transaction
Manager
Storage Manager
Data Dictionary
Statistical
Data
Indices
Data
Disk Storage
Index
Database Management Systems
Developed By SMS (The best friends group) 8
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945















(2) 3- Tier Architecture:- :¬- Client Machine ¬i Front end ¬ ª¤ - ¤ ¤in - l¬¤i ¬ini r n·ii ¤r -’ii·
Directly Database Calls ¬i ·ri ºªini+ Client -’ii· forms ¬ riºi Application Server ¬ Internet ¬ºni r +
Application Server (i( - Database ¬i Database ¬i Access ¬ºni r + (·i Application ¬ l¬¤ Three-tier ¬i
¬¤¤ ·n ºrni r+ l¬¬ www (World Wide Web) ¤º º· l¬¤i ¬i ¬¬ni r +

ADVANTAGES & DISADVANTAGES OF DBMS
ADVANTAGES %&
(1) Redundancy Control:- DBMS ¬ riºi rº Logical Data Item ¬i ¤¬ ¬nr --iº l¬¤i ¬ini r l¬¬¬
Information ¬i ¬·¬ Copies ·ri (·ni ( ·¤i(i Storage Space ·ii ·ri ¬nni r+ l¬¬¬ ·¤i(i Updation
¬i Problem ·ii ·ri ¬ini+
(2) Access Control:- Database Administrator ¬ º·ii (Security) ( Authorization ¬i ¬¤¤in ¬ l¬¤
¬¤¬··i ¬º(ini r ¬n DBA ¤i Data n·ii User (i·i ¤º ¤ºi Control rini r+
(3) Program Object rFkk Data Structure ds fy;s iw.kZ LVksjst%& Objects l¬·r Database - Store l¬¤i
¬ini r ¤ Program Execution n·ii Transmination ¬ l¬¤ ¬-iº(i¤i rini r+ Database - ¬¤l-·in ·i-i ¬i
(iº÷(iº ¬: User riºi ¬¤¤in - l¬¤i ¬i ¬¬ni r+
(4) Multiple User Interface:- rº User Database ¬ ¬¤· -(¤ ¬ ¤in i- ( Interface ¬ ¬i·iiº ¤º Interact
¬ºni r :· Interface ¬i l(l·i·· ¤ in il-n ·ii·ii¬i - develop l¬¤i ¬i ¬¬ni r+ ¤º·n ¬·¬i Database ¬
Compalible ri·i ¬i(’¤¬ r+
(5) Data ¬i Enter ¬º· ¬ l¬¤ DBMS riºi (r n ¬i ¬i-i¬i ¬i ¤lº·iil·in l¬¤i ¬ini r n·ii :·r Process riºi
¬¤¤in ·ii l¬¤i ¬ini r +
(6) Backup & Recovery:- DBMS Faliure ¬ ¬iººi ¬: (iº Problem - ¬i ¬ini r ¤º·n DBMS riºi
Faliure (Hardware ¤i Software) ¬ Recover ri· ¬ ·ii ¬: ¬i·i· ¬¤¬··i r l¬¬- ·i-i ¬i Inconsistent
Data - ¬i· ¬ (¤i¤i ¬i ¬¬ni r +
(7) Data Sharing:- r- ¬i·n r l¬ DBMS - ·i-i ¬i l¬¤ ¤¬ ri ¬i¤i --iº rini r :¬i ¬i¤i ¬i (r n ¬
Users riºi ¬¤¤in - l¬¤i ¬ini r+
(8) Data Abstraction ¬i n ºi ri· ¬ ¬iººi ·i-i(¬ ¬ Structure ¬i l(·i Users ¬i ¤º’ii· ¤i Disturb l¬¤
Modification l¬¤i ¬i ¬¬ni r+
(9) Database rº ¬-¤ Users ¬i Latest Information Provide ¬ºni r+



USER
Application
Client
USER
Application
Database
System
APPLICATION
SERVER
Database
System
Network Network
Server
2-Tier Architecture
3-Tier Architecture
Database Management Systems
Developed By SMS (The best friends group) 9
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
DISADVANTAGES:-
(1) Database System ¬ l¬¤ ¤ iºl-·i¬ Investment ¬l·i¬ rini r l¬¬- Hardware Software ( ¬·¤
Trainings ·ii ºii-i¬ rini r+ ¬nº Cost High ri ni (¬ºi nºi¬i «« ¬·i ¤ilr¤+
(2) DBMS ¬ ¬i·i ¬·¤ ¬¤lº·¤¤i ¬ ¬ Security Concurrency Control, Recovery n·ii Integrity
Constriants ¬il( ¬i ·ii ºiil-¬ ¬º·i ¬i(’¤¬ rini r+
(3) ¬ s ¤lºl-·iln¤i l¬¬- Database n·ii ¬· ¤º ¬¤¤in ¬i ¬i· (i¬i Application Simple ri n·ii ¤¬ ¬-( ¬-¤
n¬ ¤l( ¬¬ Change · ¬º·i ri ni DBMS ¬i ¤ºi ¬¤¤in ·ri l¬¤i ¬i¤ni+ n·ii ¬¬¬ ¬ s Features ¬i
¬¤¤in - ·ri l¬¤i ¬ini+
(4) ¬·ii÷z Database System ¬i Sigle User ¬ l¬¤ ri (·i¤i ¬ini r + :¬¬ l¬¤ ·ii DBMS Suitable ·ri r+
MPPING CONSTRAINTS:- Enitity n·ii Relationship ¬i l·-· ¬i-i¬i ¬ ¬·nn n ¤lº·iil·in l¬¤i ¬ini r ÷
(1) MAPPING CARDINALITIES (-l¤n ¬i· ·l¬l-)
(2) Participation Constraints (¤il- l¬¤’i· ¬·¬--)
(1) MAPPING CARDINALITY:- :·r « ·iini - (i-i n¤i r÷
(1) One to One:- Entity A ¬l·i¬ ¬ ¬l·i¬ B ¬i ¤¬ Entity ¬ Connected ri n·ii B ¬i ¤¬ Entity ¬l·i¬ ¬
¬l·i¬ A ¬i ¤¬ Entity ¬ ¬ (·iin ri+






ONE to ONE
(2) One to Many:- A ¬i ¤¬ Entity b ¬i (r n ¬i Entity ¬ ¬(·iin ri ¬¬ni r+ ¤º·n b ¬i ¤¬ Entity ¬l·i¬
¬ ¬l·i¬ A ¬i ¤¬ Entity ¬ ri ¬(·iin ri ¬¬ni r +





One to Many
(3) Many to One:- A ¬i ¤¬ Entity ¬l·i¬ ¬ ¬l·i¬ B ¬i ¤¬ Entity ¬ ¬(·iin ri ¬¬ni r + ¤º·n B ¬i ¤¬
Entity A ¬i (r n ¬i Entities ¬ ¬(·iin ri ¬¬ni r+





Many to One
(4) Many to Many:- A ¬i ¬·¬ Entities B ¬i ¬·¬ Entities ¬ ¬(·iin ri ¬¬ni r ¬¬i ¤¬iº B ¬i ¬·¬
Entities A ¬i ¬·¬ Entities ¬ ¬(·iin ri ¬¬ni r+





Many to Many

a1

a2

a3
b1

b2

b3
a1

a2

a3
b1
b2
b3
b4
b5
a1
a2
a3
a4
a5
b1

b2

b4
a1
a2
a3
a4

b1
b2
b3
b4
Database Management Systems
Developed By SMS (The best friends group) 10
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
KEYS:-
(1) Super Key:- Super Key ¤¬ ¤i ¤¬ ¬ ¬l·i¬ Attributes ¬i ¬-r r l¬¬¬ l¬¬i Entity Set ¬i Uniquely
l¬¤i ¬i ¬¬ni r+ ¬ ¬ Customer Table l¬¬- (Customer ID, Customer Name, Customer City) ¬il( r ¬ l¬¤
Customer_id Super Key r ·¤il¬ :¬¬ Customer Table ¬i Uniquly Identify l¬¤i ¬i ¬¬ni r+ ¬¬i ¤¬iº
(Customer_id + Customer_name, Customer_id _ Customer_city) ·ii Super Key r ·¤il¬ :·¬ ·ii Customer
Table ¬i Uniquely Identify l¬¤i ¬i ¬¬ni r + ¤º·n Customer name, Customer City ¬i Super Key ·ri -i·i
¬i ¬¬ni ·¤il¬ Customer ¬i ·i- ¤i Customer ¬i City Same ri ¬¬ni r +

(2) Candidate Key:- Super ¬i ¬i Concept User ¬ l¬¤ ¤¤i·n ·ri rini r+ ·¤il¬ Super Key - ¬ s Extra
Attributes ¬i ·ii ºiil-¬ l¬¤i ¬ini r+ ¬n Super Key ¬i Minimisation ¬º·i Candidate Key ¬r¬ini r+
Customer_name ( Customer Street (i·i Attributes ¬ riºi Customer Table ¬ Record ¬i Uniquely
identify l¬¤i ¬i ¬¬ni r+ ¬n Customer_id ( Customer name + Customer_Street (i·i Candidate Key
rini+ ¤º·n Customer name, Customer City ( Customer_id ¬i Combination Candidate Key ·ri rini r +

(3) Primary Key:- Candidate Key - ¬ l¬¬i ¤¬ Key ¬i as a Primary Key Choose ¬º l¬¤i ¬ini r + (¤º·n
¤r (in ·¤i· ºªi·i ¬i(’¤¬ rini r l¬ Primary Key - ¬·ii ·ii Null Value) ¬i Conidor ·ri l¬¤i ¬ini r + ¬n
Primary Key - Null Value ri ¬¬ni r+

(4) Composite Key:- ¬·ii÷z Relation ¤i Table - ¬i: ·ii ¤¬ Key ·ri rini l¬¬ Primary Key (·i¤i ¬i ¬¬+
¬n (i Attributes ¬i :¬--i ¬º ¬¬ Primary Key (·i¤i ¬ini r ¬¬ Comosite Key ¬rn r +

(5) Foreign Key:- ¬( l¬¬i ¤¬ Table ¬i Primary Key ¬i (¬ºi Table - ·ii ¤ (l’i n ¬º·i ri ni (¬ºi Table -
(r Primary Key Attribute Foreign Key ¬r¬ini r+

E-R Diagram:- E-R Diagram ¬ riºi ·i-i(¬ ¬ Logical Structure ¬i Graphically ¤ (l’i n l¬¤i ¬ini r+ E-R
Model ¬ ¬ s n-( l·-· r÷
(1) Rectangles:- ( ) Entity Set ¬i :¬¬ riºi ¤ (l’i n l¬¤i ¬ini r+
(2) Ellipses:- ( ) :¬¬ riºi Attributes ¬i ¤ (l’i n l¬¤i ¬ini r+
(3) Diamonds:- ( ):- :¬¬ riºi Relationship Set ¬i ¤ (l’i n l¬¤i ¬ini r+
(4) Lines:- (&&):- Entity ( Entity Set ¬ (i¤ - Relationship ¬i Link ¬ riºi ¤ (l’i n l¬¤i ¬ini r+
(5) Double Ellipses ( ):- Multi value Attributes ¬i ¤ (l’i n l¬¤i ¬ini r+
(6) Dashed Ellipses ( ):- :¬¬ riºi derived Attributes ¬i ¤ (l’i n l¬¤i ¬ini r+
(7) Double Rectangles:- ( ):- Weak Entity Set ¬i Double Rectangle ¬ riºi ¤ (l’i n l¬¤i ¬ini r+
E-R Diagram ¬ riºi Mapping Eardinality ¬i ·ii ¤ (l’i n l¬¤i ¬i ¬¬ni r+
(1) One to One:- ¤ (l’i n ¬º· ¬ l¬¤ ( ) ¬i ¬¤¤in - ¬n r +
(2) One to Many:- ¤ (l’i n ¬º· ¬ l¬¤ ( ) ¬i ¬¤¤in - ¬ n r +
(3) Many to One:- ¤ (l’i n ¬º· ¬ l¬¤ ( ) ¬i ¬¤¤in - ¬ n r +
(4) Many to Many:- ¤ (l’in ¬º· ¬ l¬¤ ( ) ¬i ¬¤¤in - ¬n r +









One to One

Cust-ID
Customer_name Customer_Street
Customer_City
Customer

Borrower
Loan
Loan
Number
Amount
Database Management Systems
Developed By SMS (The best friends group) 11
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945










One to Many









Many to One










Many to Many

STRONG & WEAK ENTITY SET:- ¬s ¤¬ Entity Set rin r l¬·- Primary Key ¬i Define ri ·ri l¬¤i
¬i ¬¬ni+ :¬ ¤ ¬iº ¬ Entity Set ¬i Weak Entity Set ¬rn r +
¤º·n ¬( l¬¬i Entity Set - Primary Key ¬i define l¬¤i ¬ini r ni ¬¬ Strong Entity Set ¬rn r +
Weak Entity Set ¬i Meaning ful (·i· ¬ l¬¤ ¬¬ l¬¬i (¬ºi Entity ¬ ¬··- l¬¤i ¬ini r+ ¬¬ Entity Set ¬i
Identity ¤i Owner Entity Set ¬ri ¬ini r n·ii (r Weak Entity Set Owner Entity Set ¤º dependent rini r+
Generalization:- Database design Process ¬i Bottom up ·iiººii - ·ii (·i¤i ¬i ¬¬ni r l¬¬- Multiple Entity
Sets ¬i higher Level Entity Set - ¬·¬ Common Features ¬ ¬i·iiº ¤º ¤lº(ln n ¬º l(¤i ¬ini r+
Agreegation:- :¬- l¬¬i Database Retrieval Process - No. of Inputs ¬ ¬i·iiº ¤º Single Output Generate
l¬¤i ¬ini r ¬ ¬ ¤l( ¬-¤·i - ¬i- ¬º· (i¬ Employees ¬i Gross Salary l·¬i¬·i r ni No. of Inputs - ¬·ii
Employees ¬i Dalary ¬i¤ni n·ii ¬¬¬i Output ¤¬ ¬·ii n Gross Salary rini+
Reducing E-R diagrams into Tables:- (E-R Diagram ¬i -(¬ - ¤lº(ln ¬º·i)
E-R Database Schema ¬i Group of Table - ºªii ¬i ¬¬ni r+ Database ¬ rº Entity Set ( Relationship Set
¬i ¤¬ ¬¬n -(¬ - Store l¬¤i ¬ini r ( ¬¬ ¤¬ ¬¬n ·i- ¬ ¤lº·iil·in ¬ºn r+
Cust-ID
Customer_name

Customer_Street
Customer_City
Customer

Borrower
Loan
Loan
Number
Amount
Cust-ID
Customer_name

Customer_Street
Customer_City
Customer

Borrower
Loan
Loan
Number
Amount
Cust-ID
Customer_name

Customer_Street
Customer_City
Customer

Borrower
Loan
Loan
Number
Amount
Database Management Systems
Developed By SMS (The best friends group) 12
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
E-R Model n·ii Relation Model (i·i ri Relation World Entities ¬i ¤ (l’i n ¬ºn r+ ¬n (i Model ¬i ¤¬ ¬
design Principles ¬i Follow ¬ºn r ¬n E-R Design ¬i Relational Design - ¤lº(ln n ¬º l(¤i ¬ini r +

CUSTOMER
NAME CUST_ID ADDRESS CITY
RAM 404 M.G. ROAD JODHPUR






(1) E-R Diagram ¬ ¤lº(ln n -(¬ ¬i Relation ¬rn r+
(2) Table ¬ Colums ¬i Attributes ¬ri ¬ini r+
(3) ¤¬ Record ¬i Tuple ¬rn r+
(4) l¬¬i Attributes - ¬¤l-·in Value ¬i Domain ¬rn r+


Relation
Attributes
Tuple
Domain
Database Management Systems
Developed By SMS (The best friends group) 13
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
UNIT-II
Integrity Rules:- Integrity Constrains ¬ riºi ¤r Ensure l¬¤i ¬ini r l¬ Authorized Users ¬ riºi ¬(
·i-i(¬ - ¬ s ((¬i( l¬¤ ¬in r ni ¬¬¬ ·i-i( ¬ - Inconsistency Maintain ·ri rini+
“Integrity Constraints ¬ - ª¤ ni-¤¤ ¤r r l¬ Data ¬i ¬s ¬i-i¬i ¬ ¬·nn n ¤¬ ¬i·i ºªi·i l¬¬¬ ·i-i(¬ -
Consistency (·i ºr+
Integrity Constraints ¬i - ª¤n « ·iini - (i-i n¤i r ÷
(1) Domain Integrity
(2) Entity Integrity
(3) Referential Integrity
(4) User defined Integrity
(1) Domain Integrity:- Data Base ¬ l¬¬i Relation - l¬¬i Attribute - Insert ¬i n: Value ¬i Domain
¬ri ¬ini r + ¬n l¬¬i ·ii Attribute - Data ¬i Possible Value ¬i Insert ¬º·i ri Domain Integrity ¬r¬ini r+
¤l( l¬¬i Record ¬ Particular Domain - Value ·ri ·i¬i n: r ni ¬¬- Value ¬i Insert ¬º l(¤i ¬ini r +
(2) Entity Integrity:- ¬·ii Real World Objects ¬i Entity ¬ri ¬ini r ( rº Entity ¤¬ (¬º ¬ ¬¬n rini r+
¬( l¬¬i ¤¬ Entity Set ¬i Entity - ¤¬ ri Data Type ¬i Values l¬¤i ¬ini r ni ¬¬ Entity Integrity ¬ri
¬ini r+
(3) Referential Integrity:- Referential Integrity Foreign Key ¤º l··i º ¬ºni r+ ¬( l¬¬i -(¬ ¬i Primary
Key Attribute ¬i l¬¬i (¬ºi -(¬ - ·ii Consider l¬¤i ¬ini r ni (¬ºi -(¬ - (ri Attribute Foreign Key
Attribute ¬r¬ini r + ¬n (i·i Relation ¬ Key Attributes ¬i Value ·ii ¬-i· ri·i ¤ilr¤+ :¬ ¤ ¬iº ¬
Constraint (¬i-i) ¬i Referential Integrity ¬ri ¬ini r+
(4) User Defined Integrity:- ¬¤ºi·n Integrity Constraints ¬ ¬¬i(i User ¬s ¬·¤ Integrity Constraints ¬i
·ii Database ¤º Implement ¬ri ¬ini r + ¬ ¬ Database - l¬¬i ·ii Record ¬i Insert ¬º· ¬ l¬¤ 1
st
Letter ¬i
Capital l¬ªi·i ¬il(+

RELATIONAL ALGEBRA
(1) Relation Algebra Procedural Query Language r +
(2) :¬- Input ¬ ª¤ - ¤¬ ¤i (i Relation ¬i l¬¤i ¬ini r ( Result ¬ ª¤ - ¤¬ ·¤i Relation (·ni r+
(3) Relational Algebra ¬ - ª¤ Operations Select, Project, Union, Set Difference ( Cartesian Product
r+

FUNDAMENTAL OPERATION OF RELATIONAL ALGEBRA:-
(1) Select Project Operations ¬i Unary Operation ¬ri ¬ini r ·¤il¬ ( l¬¤ ¤¬ Relation ¤º Operation
Perform ¼n r +
(2) ¬·¤ ni· Operations Union, Set difference ( Cartesian Product ¬i Binary Operations ¬ri ¬ini r
·¤il¬ :·r Perform ¬º· ¬ l¬¤ (i Relations ¬i ¬i(’¤¬ni r+
(1) Select Operation:- Select Operation ¬ riºi (i n: Condition ¬ ¬i·iiº ¤º Topless ¬i Select l¬¤i ¬ini
r+ Selection ¬ l¬¤ n i¬ Letter Sigma ¬i ¬¤¤in - l¬¤i ¬ini r Slect Operation ¬ ¬i·i =, #, <, <, >, > ¬il(+
Operation ¬i ·ii ¬¤¤in - l¬¤i ¬i ¬¬ni r+
Selection Operation ¬ ¬i·i Logical Operation Perform ¬º· ¬ l¬¤ Logical Operator ¬i ¬¤¤in - l¬¤i ¬ini
r+ :¬¬ l¬¤ and(^), or (v), Not ( ¬) Symbol ¬i ¬¤¤in - ¬ n r +

Example:-
(1) Loan Relation - ¬ Delhi Branch ¬ Records ¬i ¬¬·- ¬º·i+
branch-name = ‘Delhi’ (LOAN)
(2) Loan Relation - ¬ ¬· Records ¬i Select ¬º·i l¬·¬i Amount >1200 ri+
Amount >1200 (LOAN)
Database Management Systems
Developed By SMS (The best friends group) 14
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
(3) Loan Relation - ¬ ¬· Records ¬i Select ¬º·i l¬·¬i Amount >1200 ( Branch delhi ri+
branch-name = ‘Delhi’ ^ Amount >1200 (LOAN)
(2) Project Operation :- ¤l( Selected Data ¬i List ¬i Display ¬º·i ri ni Project ¬i ¬¤¤in - l¬¤i ¬ini r
:¬¬ l¬¤ n i¬ Letter ( ∏) ¬i ¬¤¤in - ¬n r +

Example:-
(1) 10 and Relation - ¬ Loan no ( Amount Attributes ¬i Display ¬º·i+
∏ Loan No., amount (Loan)
COMBINATION OF SELECT & PROJECT:-
(1) l¬¬i ·ii Relation ¬i Information ¬i Condition ¬ ¬i·i Display ¬º· ¬ l¬¤ Select ( Project (i·i
Operations ¬i ¬¤¤in - l¬¤i ¬ini r+
¬ ¬÷ ¬· Customers ¬i Information ¬i Display ¬º·i ¬i Delhi Brach - ºrn r+
∏Customer_name (Branch_name = ‘Delhi’(Customer))

CARTESIAN PRODUCT OPERATION:- Cartesian Product Operation ¬i x riºi denote l¬¤i ¬ini r
¤r Binary Operation r l¬¬- (i Relation ¤º Operations Perform l¬¤ ¬in r :¬ Operation ¬i Perform l·-·
(i Condition - l¬¤i ¬i ¬¬ni r +
(1) (i·i Relation l¬¬ ¤º Cartesian Product Perform ¬º·i r - ¬i: ¤¬ Column Same ri· ¬i(’¤¬ r+
(2) (i·i Table - ¤¬ Column ¬-i· rini r ni ¬¬ Relation Name ( Dot (.) Operator riºi ¬¬n ¬¬n l¬¤i
¬i ¬¬ni r +
Cartesian Product ¬i Result Records ¬ Product ¬ ª¤ - ¬ini r + ¬ ¬ ¤l( ¤¬ Relation - 4 Records ( (¬º
- 5 Records r ni Result ¬ ª¤ - (5x4) = 20 Records ¬i Display l¬¤i ¬i¤ni+
Cartesian Product ¬i l·-· ¤ ¬iº Perform l¬¤i ¬i¤ni+
Relation 1 Relation 2
1 5
2 6
3 7
4 8
Relation1 × Relation2
(1,5), (1,6), (1,7), (1,8), (2,5), (2,6), (2,7), (2,8), (3,5), (3,6), (3,7), (3,8), (4,5), (4,6), (4,7), (4,8)
Example:- ¤l( ¬· ¬·ii Customers ¬ ·i- ¬i Find Out ¬º·i r l¬·ri· Delhi Branch ¬ loan l¬¤i r ni :¬¬
l¬¤ l·-· Relation Algebra Query ¬i l¬¤i ¬i¤ni+

name cust _ ( branch_name = ‘Delhi’ (borrower X loan))
SET OPERATIONS:-
(1) Union Operations:- Relational Algebra - Union Operation ¬i (U) ¬ riºi denote l¬¤i ¬ini r+ Union
Operation - (i Relation ¬i ¤¬ Relation ¬i nºr Display l¬¤i ¬ini r ¬i·i ri Relation - ¬¤l-·in Duplicates
¬i ·ii Remove ¬º l(¤i ¬ini r+
¬( (i Relation ¤º Union (U) Operation ¬i Perform l¬¤i ¬ini r ni Union ¤¬ Relation Display ¬ºni r
l¬¬- R1 Relation ¬ ( R2 Relation ¬ ¬·ii Tuples rin r ¤º·n duplicates ¬i Remove ¬º l(¤i ¬ini r+
Example:- ¤l( Bank ¬ ¬· ¬·ii Customer ¬i List ¬i Display ¬º·i r l¬·¬i Bank - Account ri ¤i l¬¬-
Bank ¬ Loan ¬ ºªii ri ¤i (i·i ni :¬¬ l¬¤ l·-· Query ¬i Perform l¬¤i ¬i¤ni÷

ame customer_n (borrower) U

ame customer_n (depositor)
Union Operation Perform ¬º· ¬ l¬¤ l·-· (i (ini ¬i ·¤i· - ºªi·i ¬i(’¤¬ r÷
(1) (i·i Relations - Same Number of Attributes ¬i ri·i ¬i(’¤¬ r +
(2) (i·i Relation - l¬¬i ¤¬ Attribute ¬i ¬-i· ri·i ¬i(’¤¬ r+
Database Management Systems
Developed By SMS (The best friends group) 15
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
(2) Intersection:- Relational Algebra - Intersection Operation ¬i ( ∩) ¬ riºi denote l¬¤i ¬ini r+ :¬- ·ii
duplicates ¬i Remove ¬º l(¤i ¬ini r +
¬( (i Relation ¤º Intersection ( ∩) Operation Perform l¬¤i ¬ini r ni Intersection ¤¬ Relation Display
¬ºni r l¬¬- Relation R1 ¬ ( Records ¬i Relation R2 - ·ii ¬¤l-·in ri (Common) ¬i Display l¬¤i ¬ini r+
Example:- ¤l( Bank ¬ ¬· Customer ¬i Find Out ¬º·i ri l¬·¬i ( ¬ - ¤¬i¬·- ·ii ri ( l¬·ri· ( ¬ ¬ ¬i· ·ii
¬ ºªii ri+

ame customer_n (borrower) ∩Customer_name (depositor)
(3) SET- Difference:- Relation Algebra - Set Difference Operation ¬i (-) ¬ riºi denote l¬¤i ¬ini r :¬-
·ii duplicates ¬i Remove l¬¤i ¬ini r+
¬( (i Relation ¤º Set difference Operation ¬i Apply ¬ºn r ni :¬- Result ¬ ª¤ - ¬· Records ¬i
Display l¬¤i ¬ini r ¬i R1 Relation - ni r ¤º·n R2 Relation - ·ri+
Example:- ( ¬ ¬ ¬·ii Customer Name ¬i List ¬i Display ¬º·i l¬¬¬i Bank - Account ri ¤º ¬¬· (¬ ¬
¬i· ·ri l¬¤i r ni :¬¬ l¬¤ l·-· Query ¬i ¬i¤ni+


ame customer_n (depositor) -

ame customer_n (borrower)
SQL:- (Structured Query Language):- SQL ¬i San Jose Laboratory - IBM riºi developed l¬¤i n¤i
·ii+ SQL ¬i (r n ¬ Parts ¬ l-¬¬º (·i¤i n¤i r÷
(1) DDL (Data Definition Language):- SQL DDL ¬ riºi Relation Rchema ¬i define, delete (
Modify ¬º· ¬ Commands ¬i Provide ¬º(i¤i ¬ini r+
(2) Interactive DML (Data Manipulation Language):- :¬- Tuples ¬i Insert, delete ( Modify ¬º· ¬
Commands ¬i Insert l¬¤i ¬ini r+
(3) View Definition:- View define ¬º· ¬ l¬¤ SQL DDL - Commands ¬i Store l¬¤i ¬ini r +
(4) Transaction Control:- Transaction ¬i Beginning ( Ending - ·ii SQL Commands ¬i Include l¬¤i
¬ini r+
(5) Authorization:- Relation ( View ¬i Access ¬º· ¬ l¬¤ Login Password l(¤ ¬in r+

Relation Database Relations ¬i Collection r l¬¬- rº Relation ¬i Unique name l(¤i ¬ini r Data base -
Unknown Values ¬ Insertion ¬i ºi¬· ¬ l¬¤ Null Values ¬i Insert l¬¤i ¬ini r+
SQL ¬i Basic Structure ni· Clauses ¤º l··i º ¬ºni r÷ (1) Select (2) From (3) Where
• Select Operation Relational Algebra ¬ (π ) Projection Operation ¬i nºr r+
• From Clause Relational Algebra ¬ Cartesian Product ¬ ¬-i· r+ (x)
• Where Clause Relational Algebra ¬ Selected ( ) Operation ¬i nºr r+

(1) Select Clause:- Select Clause ¬ riºi Records ¬i Display l¬¤i ¬ini r+
Example:- ¤l( Loan Relation ¬ ¬·ii Branch_name ¬i Display ¬º(i·i r ni l·-· Query ¬i ¬i¤ni÷
Select branch_name
From loan
¤l( Relation - ¬ duplicates ¬i Rename ¬º·i ri ni distinct Keyword ¬i Select l¬¤i ¬ini r+
Select distinct branch_name
From Loan
(2) Where Clause:- Where Clause - Relation ¬ ¬(l·in Conditions ¬i l¬ªii ¬ini r+
Example:- ¤l( Loan Relation - ¬ ¬· Records ¬i Select ¬º·i r ¬i delhi branch ¬ r ( l¬·¬i Amount
3000 ¬ ¬l·i¬ r ni :¬¬ l¬¤ l·-· Query Perform ¬i ¬i¤ni÷
select loan_no.
from Loan
where branch_name = ‘Delhi’ and amount>3000
Database Management Systems
Developed By SMS (The best friends group) 16
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
Where Clause ¬ ª¤ Relation Operator (>, <, >, <, =, #) ¬il( ¬i n·ii Logical Operator (and, or, not) ¬i ·ii
¬¤¤in - l¬¤i ¬ini r+

Codd’s Rules:- E.F. Ted Codd’s ¬ riºi Functional Database Management System ¤º Rules l·l- n l¬¤
n¤ r ¬i l·-· r÷
(1) Relation Database Management:- RDBMS riºi l¬¤ Information ¬i Relational Capabilities ¬i
Manage l¬¤i ¬ini r+
(2) Information Representation:- ¬·ii Information l¬¬ Relation Database riº ¤ (l’i n l¬¤i ¬ini r
¬·r Data Item Values ¬ ª¤ - Store l¬¤i ¬ini r ¤ ¬·ii Data Items Table - Store ºrn r +
(3) Logical Accessibility:- rº Relation ¬ Data Item ¬i Value ¬i Access ¬º· ¬ l¬¤ table ¬i ·i-
Column ( Primary Key Value ¬i define l¬¤i ¬ini r+
(4) Representation of Null Values:- DBMS ¬ riºi Null Values ¬i ·ii ¤ (l’i n l¬¤i ¬ini r+ Numeric
Values ¬ l¬¤ Null Value 0 ¤i ¬i: ¬·¤ digit rini r ( Character ¬ l¬¤ Null Value Blank Space
¤i ¬i: ¬·¤ Character Value rini r +
(5) Data Language:- RDBMS ¬ riºi Data ( Database Accessing Language ¬i ¤lº·iil·in l¬¤i ¬ini r+
(6) Insert, Update & Delete:- l¬¬i ·ii Operation ¬ riºi Database - Values ¬i Insert Updates (
Delete l¬¤i ¬i ¬¬ni r +
(7) Physical data Independence:- ¬( Physical Storage Representation ¤i Access Methods ¬i
Change l¬¤i ¬ini r ni Application Programs - Change ¬i ¬i(’¤¬ni ·ri rini+
(8) Integrity Constraints:- DBMS - Data Languages ¬ riºi Entity ( Referential Integrity ¬i
define l¬¤i n¤i r+
(9) Data Distribution:- DBMS ¬ l¬¤ l¬· Database Languages ¬i (·i¤i n¤i r ¬·¬ distribute
Database ¤º Change l¬¤ ¬i ¬¬n r+
(10) No Subversion:- DBMS User ¬ riºi ¤¬ ¬-i· l¬¤ ¤¬ Row ¤º Operation Perform l¬¤i ¬ini r
l¬¬¬ Entity ( Referential Integrity Constraints ¬i ·ii ¬ º·ii rini r+

JOINS
Natural Join:- ¬( l¬¬i Query ¤º Cartesian Product Perform l¬¤i ¬ini r ni :¬ Cartesian Product
Perform l¬¤i ¬ini r ni :¬ Product ¬ Result ¬ (i( ¬¬ ¤º Selection Condition ¬i Apply l¬¤i ¬ini r+
¬ ¬÷ ¤l( Bank ¬ ¬· ¬·ii Customers ¬i List ¬i Display ¬º·i r l¬·ri· Bank ¬ Loan ¬ ºªii r ( ¬·ii
Loan No. ( Loan Amount ¬i ·ii Display ¬º·i r ni :¬¬ l¬¤ ¬(¬ ¤r¬ Borrower ( Loan Relation ¤º
Cartesian Product Perform l¬¤i ¬i¤ni (i( - Same Loan Number (i¬ Tuples ¬i Select l¬¤i ¬i¤ni+ :¬¬
l¬¤ l·-· Query Perform ¬i ¬i¤ni÷
π customer_name, Loan_number, Amount (borrower)
Loan_number = Loan, Loan_number (borrower X Loan)
:¬ ¬--¤i ¬i (º ¬º· ¬ l¬¤ Natural Join Operation Perform l¬¤i ¬ini r l¬¬- Selection ( Cartesian
Product ¬i ¤¬ Operation - ¤lº(ln n ¬º l(¤i ¬ini r+ :¬ Symbol riºi ¤ (l’i n l¬¤i ¬ini r +
π customer_name, Loan_number, cannot (borrower Loan)
Outer Join:- Outer Join Operation Join Operation ¬i Extension r l¬¬- Missing Information ¬i ·ii
Display l¬¤i ¬ini r+ ¬ ¬÷ ¤l( r-iº ¤i¬ (i Relation r÷
Employee (Employee_name, Street, city)
Works (Employee_name, branch_name, Salary)
¬( ¤l( :· ¤º Natural Join Operation Perform l¬¤i ¬ini r ¬i (i·i Relation - ¬ Employee name ¬ ¬i·iiº
¤º Selection l¬¤i ¬i¤ni+ ¤l( ¤¬ Relation - ¤¬ ¬·¤ Employee_name r ¬i (¬º - ·ri r ni ¬¬
Information ¬i Display ·ri l¬¤i ¬i¤ni+
Database Management Systems
Developed By SMS (The best friends group) 17
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
:¬ Loss Of Information ¬i Explain ¬º· ¬ l¬¤ ( Remove ¬º· ¬ l¬¤ Outer Join Operation & Perform
l¬¤i ¬ini r+
Outer Join Operation ¬i 3 ·iini - (i-i n¤i r ÷
(1) Left Outer Join
(2) Right Outer Join
(3) Full Outer Join
(1) Left Outer Join - left Relation ¬ ¬· ¬·ii Tuples ¬i Display l¬¤i ¬ini r ¬i Right Relation ¬i
match ·ri rin+ ¬n ¬i Tuples Right Relation - ·ri r (ri ¤º Null Values ¬i Insert l¬¤i ¬ini r+
¬n Left Relation ¬i ¬iºi Information ¤ i·n rini r+
(2) Right Outer Join - Right Relation ¬ ¬· ¬·ii Tuples ¬i Display l¬¤i ¬ini r ¬i Left Relation ¬
Match ·ri rin+ ¬n ¬i Tuples Left Relation - ·ri r (ri ¤º Null Values ¬i Insert ¬º l(¤i ¬ini r+
¬n Right Relation ¬i ¬iºi Information ¤ i·n rini r+
(3) Full Outer Join - Right ( Left Relation ¬ Unmatched Operation ( tuples ¬i ºiil-¬ ¬º Display
l¬¤i ¬ini r ( Null Value Insert ¬º (i ¬ini r+

Database Management Systems
Developed By SMS (The best friends group) 18
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
UNIT-III
Functional Dependencies %&
(1) :¬ dependency ¬ riºi Bad Database Design ¬i Good Database Design - ¤lº(ln n l¬¤i ¬ini r+
(2) Functional Dependency ¤¬ ¤¬i Key r l¬¬¬ riºi Database ¤º Generalization l¬¤i ¬ini r+
(3) l¬¬i ·ii Relation - Attribute A, Attribute B ¤º n·ii l··i º ¬ºni r ¬( B ¬i rº Value ¬ l¬¤ A ¬i
Exactiy ¤¬ Value ri+
(4) Attribute B, l¬¬ ¤º Attribute A depend ¬ºni r ¬¬ determinant ¬ri ¬ini r+
(5) Functional Dependency ¬i (i ¤ ¬iº ¬ ¬¤¤in l¬¤i ¬i ¬¬ni r ÷
(1) Relation (table) ¬i ¬·ii ¬i(’¤¬ Functional dependency ¬i Check ¬º·i+
(2) Relations ¤( ¬ s ¬i(’¤¬ Limitations ¬ l¬¤ ·ii Functional dependency ¬i ¬¤¤in - l¬¤i
¬ini r+
Example:- ¤¬ Relation Employee l¬¬- l·-· Attributes ¬i ºiil-¬ l¬¤i n¤i r+
Employee = {Ecode, Name, City}
EMPLOYEE

Ecode Name City
E1 A1 Delhi
E2 A2 Calcutta
E3 A3 Madras

¬¤ºi·n Employee Table - rº Ecode ¬ l¬¤ Name ¬i Exact ¤¬ Value ¬ l¬¤ r+ ¬n ¤r ¬ri ¬i
¬¬ni r l¬ Name Ecode ¤º Functionally dependent r+ ¬n Ecode ¬i determinant ¬ri ¬ini r+ ¬n Ecode
¬ ¬i·iiº ¤( Name ( City (i·i ¬i Access l¬¤i ¬i ¬¬ni r +
Normalization ¬i ¤ºi Concept Functional dependency ¤º l··i º ¬ºni r +
Relational Database Design ¬i ¬l-¤i l·-· r÷
Bad Database design - l·-· ¬l-¤i ¬i ¤ (l’i n l¬¤i ¬ini r ÷
(1) Repetetion of Information
(2) Information ¬i ¬·ii÷z ¤ºi nºr ¬ ¤ (l’i n ·ri l¬¤i ¬ini+
(3) Database - Insertion ¬ ¬-¤ ¬i· (i¬i ¬--¤i r+
(4) Database - deletion ¬ ¬-¤ ¬i· (i¬i Problem:-
:· ¬·ii ¬--¤i¬i ¬i Database ¬ r-i· ¬ l¬¤ Relation ¬i si-÷z ·iini - (i-¬º ·¤ Relation (·i¤ ¬in
r l¬¬¬ l¬¬i ·ii ¤ ¬iº ¬i Information Loss · ri+ :¬ ¤¬iº ¬i l(l·i¤i ¬i decomposition Tecniques ¬ri ¬ini
r ¤i Loss-less Join ¬ri ¬ini r ¤i Lossy decomposition ¬ri ¬ini r+
¬ ¬ ¤¬ Relation R r ¬( Database Anomalies (¬l-¤i) ¬i (º ¬º· ¬ l¬¤ si- ÷z ·iini - (i-i ¬ini r ni÷
R = {r1 U r2 U r3 ………. U rn}
¤i
R = {r1 U r2 U r3 ………. U rn}
¬n ¬( ¬·ii decomposed Relation ¬i l-¬i¤i ¬ini r ni ¤ · Relation R (·ni r ( l¬¬i ·ii Information ¬i
loss ·ri rini r+
UNIVERSAL RELATION APPROACH:- Database Design ¬ ¬-¤ Single Relation ¬i ¬¬º ¬¬- ¬·ii
¬i(’¤¬ Attributes ¬i ¬¤¤in - ¬ l¬¤i ¬ini r+ n·ii (i( - :¬ Relation ¬i si-÷z ·iini - (Relation) - l(·i·n
¬º l(¤i ¬ini r + Decomposition ¬i - ª¤ ¬( (’¤ Information Loss ¬i · ri· ( ·i r+
Example:- ¤¬ Loan Relation - l·-· Attributes ¬i ¤lº·iil·in l¬¤i n¤i r÷
Loan:- (i) Branch Name, Loan Number
(ii) Loan_number, Amount
(iii) Loan_number, Customer Name
Database Management Systems
Developed By SMS (The best friends group) 19
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
¬¤ºi·n ni· decomposed Relation r+ :¬- ¬ (i) Relation - Loan Amount ¬i Store ·ri l¬¤i n¤i r
ni :¬ ¤¬iº ¬ Records ¬i danling Records ( tuples ¬i dangling Tuples ¬ri ¬ini r ·¤il¬ ¬( ·ii :· ni·i
Tables ¬i Join ¬º¬ data Access l¬¤i ¬i¤ni n( Record Information ¬·iºi ¤ i·n rini ·¤il¬ Loan Amount ¬i
Insert ·ri l¬¤i n¤i r+ :¬¬ l¬¤ Record Information ¬i ªii¬i · ºªi¬º Null Value ¬i Insert ¬º l(¤i ¬ini r
n·ii :¬ ¤¬iº ¬ Relations ¬i Universal Relation ¬ri ¬ini r+ (¤l·(¬ ¬) ¬n Null Value ¬i l(·i Database -
l¬¬i ·ii Unknown Value ¬i Insert ·ri l¬¤i ¬ini+

NORMALIZATION:- Normalization ¤¬ ( nil·¬ l(l·i r l¬¬¬ riºi Complex Table Structure ¬i Simple
Table Structure - ¤lº(ln n l¬¤i ¬ini r+
Table - ¬ Redundancy ¬i ¬- ¬º· ( Database Inconsistency ¬i r-i· ¬ l¬¤ ¬ s Rules ¬i Follow
¬º ·i- ¬i:¬’i· l¬¤i ¬ini r+ :¬- ¤r ·ii ·¤i· ºªii ¬ini r l¬ Normalization ¬ ¬-¤ Information ¬i ¬i: Loss
·i ri+
Normalization ¬ (r n ¬ ¬i·i r l¬¬¬ riºi Fast Sorting, Indexing ( Clustering ¬i ¬i ¬¬ni r ( ¤r
Table Structure ¬i Simple (·i· ¬i ¬i¤ ·ii ¬ºni r+ l¬¬i ·ii Database Design ¬i ¬·si (·i· ¬ l¬¤ l·-·
Rules ¬i Follow l¬¤i ¬ini r÷
(1) rº Table - ¤¬ Identifier ¬i ri·i ¬i(’¤¬ r+
(2) rº Table - Singal Type ¬i Entity ¬i Store l¬¤i ¬i·i ¤ilr¤+
(3) Null Value ¬i ¬- ¬ ¬- Store l¬¤i ¬i·i ¤lr¤+
(4) Values ¬i Repetition (¤ ·ºi(ln) ·ii ¬- ¬ ¬- ri·i ¤ilr¤+
Normalization Concept ¬i Apply ¬º· ¬ l¬¤ ¬¬n÷z Normal Forms ¬i ¬¤¤in - l¬¤i ¬ini r + -(¬
r-’ii l¬¬i · l¬¬i Normal Form - rini r + - ª¤n ¬¤¤in - ¬i ¬i· (i¬i Normal Forms l·-· r ÷
(1) First Normal Form (1NF)
(2) Second Normal Form (2NF)
(3) Third Normal Form (3NF)
(4) Fourth Normal Form (4NF)
(5) Boyce Coded Normal Form (BCNF)
(6) Fifth Normal Form (5NF)
(1) First Normal Form (1NF):- l¬¬i ·ii -(¬ ¬i 1NF - n·ii ¬ri ¬i ¬¬ni r ¬( -(¬ ¬i rº Cell - ¤¬
Value ri+
Example:- ¤¬ Relation Employee - l·-· Attributes ¬i Insert l¬¤i n¤i r÷
Ecode:- (Ecode, Dept, Proj Code)
Employee
Ecode Dept Proj Code
E 101 Finance P27
P51
P20
E 303 Purchase P27
P22
E 709 Sales P51
P27

¬¤ºi·n -(¬ - ¬·ii Cell Value ¬i Insert ·ri l¬¤i n¤i r ¤º·n Projcode Values ¤¬ ri Cell - ¤¬ ¬
¬l·i¬ r+ ¬n ¤r Table Normalizaed Form - ·ri r ¬n :¬ ¤º 1NF ¬ Rule ¬i Apply l¬¤i ¬i¤ni n·ii Table
l·-· ¤ ¬iº (·ni÷


Database Management Systems
Developed By SMS (The best friends group) 20
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
Employee

Ecode Dept Proj Code
E 101 Finance P27
E 101 Finance P51
E 101 Finance P20
E 303 Purchase P27
E 303 Purchase P22
E 709 Sales P51
E 709 Sales P27
¬¤ºi·n Table 1NF - r +
(2) Second Normal Form (2NF):- ¬i: ·ii Table 2NF - n·ii rini ¬( (r 1NF - ri n·ii Row ¬i rº
Attribute Primary Key ¤( Functionally Dependent ri·i ¤ilr¤ · l¬ Primary ¬i ¬ l¬¬i Part ¤º+
¬n l¬¬i ·ii -(¬ ¬i 2NF - ((¬· ¬ l¬¤ l·-· l·¤-i ¬i Follow l¬¤i ¬ini r÷
(1) ¬· Attributes ¬i Find ¬º ¬·r r-i·i ¬i Primary Key ¬i Part (·iin) ¤( dependent ri+ ¬·r ¬¬n -(¬
- Store ¬º·i+
(2) ¬·¤ (¤ Attributes ¬i ¤¬ ¬i·i ¤¬ -(¬ - ºªi·i+
Example:- Project Table - l·-· Attributes ¬i ºiil-¬ l¬¤i n¤i r ÷
Project:- (Ecode, Pcode, Dept, Hours}
PROJECT

Ecode Pcode Dept Hours
E1 P27 Finance 90
E2 P27 Pruchase 5
E3 P51 Sales 7
E1 P51 Finance 100
E1 P20 Finance 50
E3 P27 Sales 30

¬¤ºi·n Table 2NF - ·ri r ¤i Table - l·-· ¬--¤i r ÷
(1) l¬¬i ·ii Employee ¬ department ¬i n( n¬ Store ·ri l¬¤i ¬i ¬¬ni ¬( n¬ l¬ ¬¬ ¬i: Project ·
l(¤i n¤i ri+
(2) Code ( Dept. (iº÷z Repeat ri ºr r ¬n Information Updation - ·ii Problems ¬i¤ni+ l¬¬¬
Inconsistency («ni+
(3) ¤l( ¬i: Employee Project Complete ¬º ¬ni r ni Employee ¬i Record ¤i Project Delete ¬º· ¤(
¤ºi Record Delete ri ¬i¤ni+
¬¤ºi·n Table Non Key Attribute (¬i Primary Key - ºiil-¬ ·ri r) ¤ºi Primary Key (Key Attribute) ¤(
Functionally Depend ri· ¤ilr¤+
(1) ¬(¬ ¤r¬ Dept. (Non-Key Attribute) ¬i dependency ¬i ¤ ¬ l¬¤i ¬i¤ni+ Ecode ¬ l¬¤ Dept ¬i
Value ¤¬ r-’ii ¤¬ r ¬n Dept, Ecode in Functionally Dependent r + ¤º·n Proj Code ¬ l¬¤ Dept.
¬i Value ¤¬ ¬ ¬l·i¬ r ¬n Dept Pcode ¤( Functionally dependent ·ri r +
¬n Ecode+Pcode ¬i ºiil-¬ (Whole Key) ¬º· ¤( ·ii Dept Functionally Dependent ·ri r ¬n dept
Ecode ¤( ni Functionally dependent r ¤º·n Pcode ¤( ·ri ¬n Part of the Primary Key ¤º Dept ¤º ·ri+
(2) Hours (Non-Key Attribute) ¬i dependency ¬i Check ¬º·i r + Ecode ¬ l¬¤ Hours ¬i ¤¬ ¬
·¤i(i Value r ¬n Hours, Ecode ¤( Functonally Dependent ·ri r+ rº Project ¬ l¬¤ ¤i Pcode ¬ l¬¤ ·ii
Hours ¬i ¤¬ ¬ ¬l·i¬ Values r ¬n Hours, Pcode ¤º ·ii Functionally Dependent ·ri r+ ¤º·n ¬( ¤ºi n
Primary Key ¬i (in ¬i ¬ini r ni Hours (Pcode+Ecode) ¤( Functionally dependent r +
Database Management Systems
Developed By SMS (The best friends group) 21
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
¬n Dept ¤¬ ¤¬i Non-Key Attribute r ¬i Relation ¬i Primary Key ¤( Functionally Dependent
·ri r + ¬n ¬¬ Non Key ( Key Attribute l¬¬ ¤º Depend ¬ºni r (i·i ¬i Table ¬ ¬¬n ¬º l(¤i ¬i¤ni+
(1) Dept = {Ecode, Dept}
(2) Project = {Ecode, Pcode, Hours}
(3) Third Normal Form (3NF):- ¬i: ·ii Relation 3NF - n·ii ¬r¬ini r ¬ ((r Realtion 2NF - ri
n·ii rº Non-Key Attribute l¬¤ ¬i º l¬¤ Primary Key ¤º dependent ri+
¬n l¬¬i ·ii Table ¬i 3NF - ((¬· ¬ l¬¤ l·-· Rules ¬i Follow l¬¤i ¬ini r ÷
(1) ¬· Non Key Attributes ¬i ««¬º Rename ¬º·i ¬i Primary Key ¬ ¬¬i(i ¤¬ (¬º ¤º ·ii depend
¼ni ri+
(2) ¬· ¬·ii Attributes ¬i ¤¬l¤n ¬º·i+
Example:- ¤¬ Relation Employee - l·-· Attributes ¬i ºiil-¬ l¬¤i n¤i r÷
Employee = {Ecode, Dept, Dept Head}
EMPLOYEE

Ecode Dept Dept Head
E1 Sales E705
E2 Pruchase E302
E3 Purchase E302
E4 Sales E705
E5 Finance E301

¬¤ºi·n Relation - ¬·ii ¤ ¬iº ¬i Anomalies (Problems) ¬¤l-·in r÷
(1) Updation
(2) Deletion
¬n Table ¬i 3NF ¬ l¬¤ ¤ ¬ ¬º·i rini+ :¬ -(¬ ¬ l¬¤ Primary Key – Ecode r +
(1) rº Ecode ¬i Value ¬ l¬¤ Dept ¬i ¤¬ Value r ¬n Dept, Ecode ¤( Functionally dependent r +
(2) :¬i ¤¬iº rº Ecode ¬ l¬¤ DeptHead ·ii ¤¬ (¬º ¤( Functionally Dependent r+ ¬n :· (i·i
Attributes ¬i ¬¬n Table - decompose ¬º l(¤i ¬i¤ni+
¬n ¤¬ Relation (i Parts - divide ri ¬i¤ni÷
(1) Employee = {Ecode, Dept}
(2) Department = {Dept, Deptifead}
(4) BOYCE-Codd Normal form (BCNF):- ¬·ii÷¬·ii 3NF ¬i ¤lº·ii·i ¬ s Tables ¬ l¬¤ ¬¤¤ ·n ·ri rini
¬ ¬÷
(1) ¬( -(¬ - ¤¬ ¬ ¬l·i¬ Candidate Keys ri+
(2) ¬( Multiple Candidate Keys Composite ri+
(3) ¬( Multiple Candidate Key - ¤¬ Key Attribute Common ri+
:· ¬·ii ¬iººii ¬ ·: Normal Form develop ¬i n: l¬¬ BCNF ¬ri ¬ini r +

PROJECT

Ecode Name Pcode Hours
E1 A P2 48
E2 B P5 100
E3 C P6 15
E4 D P2 250
E4 D P5 75
E1 A P5 40

Database Management Systems
Developed By SMS (The best friends group) 22
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
:¬ Table ¬ l¬¤ Primary Key Ecode Pcode r ¤º·n name ( Pcode ¬i ·ii Primary Key ¤ ·i ¬i ¬¬ni
r ¬n ¤r Candidate Key r+
¬¤ºi·n Table - l·-· ¬¤·i¤ ¤i·n rini r÷
(1) Table - Multiple Candidate Key r ÷
(1) Ecode + Pcode
(2) Name + Pcode
(1) Candidate Keys Composite r+
(2) ¬·ii Condidate Keys - Pcode ¤¬ ¤¬i Attribute r ¬i Common r+
¬n :¬ Condition - BCNF ¬i Apply l¬¤i ¬i·i ¤ilr¤ ¤º·n ¬i·i Functional deptendency ¬i ·ii
check l¬¤i ¬ini r÷
(1) Hours Primary Key ¤( Functionally Dependent r +
(2) Hours, Name + Pcode ¤º ·ii Functionally dependent r+
(3) Name, Ecode ¤º ·ii Functionally Dependent r +
(4) Ecode ·ii Name ¤º Functionally Dependent r +

¬n BCNF ¬ l¬¤ l·-· Rules ¬i Follow l¬¤i ¬i¤ni÷
(1) Overlapped Condidate Key ¬i « «¬º ¬¬ Remove ¬º·i ( (r l¬¬ ¤( dependent r ¬¬¬ ¬i·i ¬¬n
Table - decompose ¬º·i+
(2) ¬·¤ Attributes ¬i ¤¬ ¬i·i ¤¬ Table - ºªi·i+
¬n Name ( Ecode ¬i ¬¬n Table - ºªii ¬i¤ni÷

(1) Employee:- Ecode Name
(2) Project:- Ecode Pcode Hours
(4) Fourth Normal Form (4NF):- ¬·ii Normal Form (BCNF) n¬ Apply ¬º· ¤º ·ii Relation - ¬i
Main Problem ºr ¬ini r (r r Information ¬i Repeat ri·i+
¬( ¤¬ ri Attribute ¬ l¬¤ l¬¬i (¬º Attribute ¬i ¤¬ ¬ ¬l·i¬ Values ri ni :¬ ¤ ¬iº ¬i ¬--¤i ¬i (º
¬º· ¬ l¬¤ Multivalued dependency ¬i Apply l¬¤i« ¬ini r+ l¬¬ Normal Form - Multivalue
dependency ¬i Consider l¬¤i ¬ini r ¬¬ 4NF ¬ri ¬ini r+
5NF (PJNF):- ¬( Relation - Join dependency ¬i Consider l¬¤i ¬ini r ni :¬ ¤ ¬iº ¬i Normal
Form Project Join Normal Form ¤i Fiften Normal Form ¬r¬ini r +
Database Management Systems
Developed By SMS (The best friends group) 23
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
UNIT-IV
INDEXING & HASHING
l¬¬i Book ¤i Card Catalog ¬i nºr ri Database ¬ Indexes ¬i Maintain l¬¤i ¬ini r+ ¬(i ¤l(
Account Number ¬ ¬i·iiº ¤º Account Table ¬ Record Add ¬º·i ri ni Database System Index - ¬ Disk
Block « «¬º Record ¬i Main Memory - ¬ini r +
¤l( Index ·ii Sorted ri ni Record ¬i ««· - ¬-¤ ¬- ¬nni r + - ª¤n (i ¤ ¬iº Index ¬i ¬¤¤in - l¬¤i
¬ini r÷
(1) Ordered Index:- ¤r Database ¬i Sorted Values ¤º l··i º ¬ºni r+
(2) Hash Index:- :¬- Values ¬i Bucket - Uniformly Store l¬¤i ¬ini r+ Bucket - l¬¬i Value ¬i
Store l¬¤i ¬ini r :¬¬ l¬¤ ¤¬ Function ¬i ¬¤¤in - l¬¤i ¬ini r l¬¬ Hash Function ¬ri ¬ini r+
(i·i ¤ ¬iº ¬i Indexing ¬ l¬¤ (r n ¬i l(l·i¤i ¬¤·i: n: r ¤º·n ¬i: ·ii n¬·i¬ ¬¤¤ ·n ·ri r + rº
Technique ¬i - ª¤n l·-· Factors ¬ riºi -i¤i ¬ini r÷
(1) Access Types:- :¬- Records ¬i l¬¬i Attribute ¬ Find l¬¤i ¬ini r n·ii ¬i·i ¬· Records ¬i ·ii
Find l¬¤i ¬i ¬¬ni r ¬i Specific Range - ¬ini ri+
(2) Access Time:- l¬¬i ·i-i ¬i:-- ¤i Set on item ¬i ««· - ¬ni ¬-¤+
(3) Insertion Time:- l¬¬i ·¤ Date Item ¬i Database - Insert ¬º· - ¬ni ¬-¤+
(4) Deletion Time:- l¬¬i ·i-i ¬i:-- ¬i Database ¬ Delete ¬º· - ¬ni ¬-¤+
(5) Space Overhead:- Index Structure ¬ riºi ¬lnlº·n ¬¤¤in - l¬¤i n¤i -¤¬+
(r Attribute l¬¬¬ riºi l¬¬i ¤i: ¬ ¬ Record ¬i Search l¬¤i ¬ini r Search Key ¬r¬ini r+

Ordered Indexes:- Records ¬i Fast Searching ¬ l¬¤ Index Structure ¬i ¬¤¤in - l¬¤i ¬ini r+ l¬¬i
Book ¬ Index ¬i nºr ri Ordered Index - ·ii Search Key Values ¬i Sorted Order - ¤lº·iil·in l¬¤i ¬ini r+
:¬ ¤ ¬iº ri ¤i: ¬ ¬i ¬¬n÷z Search Key ¬ ¬i·iiº ¤º Index l¬¤i ¬i ¬¬ni r+ ¤l( l¬¬i ¤i: ¬ - Records ¬i
Sequentially ºªii n¤i r ni Primary Index - Search Key Values ¬i ·ii Sequentially Define l¬¤i ¬i¤ni+
Primary Index ¬i Clustering Index ·ii ¬ri ¬ini r+ Primary Index - - ª¤n Search Key Primary Key ri
rini r+ ¤º·n ¤¬i ¬i(’¤¬ ·ri r + Sequential Order ¬ ¬¬i(i ¤l( l¬¬i ¬·¤ order ¬i use - ¬¬º Search Key
¬i define l¬¤i n¤i r ni ¤r Index Secondary Index ¬r¬ini r+
(1) Primary Index:- ¬·ii Files ¬i l¬¬i Search Key ¬ ¬i·iiº ¤º Sequentially Ordered l¬¤i ¬ini r+ ( Files
l¬¬- Search Key Primary Index ¬ Concept ¤º ¬i¤ ¬ºni r ¬·r Index Sequential File ¬ri ¬ini r+

A-No. BRANCH Amount
A-217 DELHI 750
A-101 DELHI 500
A-110 DELHI 600
A-215 HYDERABAD 700
A-102 HYDERABAD 400
A-201 HYDERABAD 900
A-218 MUMBAI 700
A-222 MUMBAI 700
A-305 MUMBAI 350
SEQUENTIAL FILE

DENSE AND SPARSE INDEX:- Ordered Index ¬i - ª¤n (i ·iini - (i-i n¤i r ÷
(1) DENSE INDEX
(2) SPARSE INDEX
DELHI

HYDERABAD

MUMBAI
Database Management Systems
Developed By SMS (The best friends group) 24
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
(1) DENSE INDEX:- ¬( ¤i: ¬ ¬i rº Search Key Value ¬ l¬¤ Index Record Maintain l¬¤ ¬in r ni :¬
¤ ¬iº ¬ Index ¬i dense Index ¬ri ¬ini r+ Sparse Index ¬i ¬¤·ii dense Index ¬ Fast Searching Perform
¬i ¬i ¬¬ni r+ Index Record - Search Key Value n·ii Search Key ¬ First Data Record ¬ Pointer ¬i ºªii
¬ini r+

A-No. BRANCH Amount
A-217 BIKANER 750
A-101 BIKANER 500
A-110 BIKANER 600
A-215 CALCUTTA 200
A-102 CALCUTTA 400
A-201 DELHI 250
A-218 MADRAS 400
DENSE INDEX

(2) Sparse Index:- ¤ Index-Record ¬ s Serach Key Values ¬i ri Store ¬ºni r+ :¬ ¤ ¬iº ¬ Index ¬
Record ¬i Search ¬º· ¬ l¬¤ Index Table ¬ ¬i ¬¬¬ (·i ¤i si-i Value ¬i Search ¬º Sequentially
Records ¬i Search l¬¤i ¬ini r+
Sparse Index ¬i ¬¤·ii Dense Index ¬ fast searching perform ¬i ¬ini r +

A-No. BRANCH Amount
A-217 BIKANER 750
A-101 CALCUTTA 500
A-110 CALCUTTA 600
A-215 MADRAS 700
A-102 PILANI 400
A-201 PILANI 900
A-218 PILANI 700
A-222 RURKI 100
A-350 RURKI 350
SPARSE INDEX

MULTILEVEL INDICES:- ¤l( Sparse Index ¬i ¬¤¤in - ¬n r ni Records ¤º Processing ¬ l¬¤ Index
·ii (r n (·i ri ¬ini r+ ¬ ¬ ¤l( ¤i: ¬ - 10,00,00 Records r n·ii rº Block - 10 Records ¬i Store l¬¤i n¤i r
( ¤l( rº Block ¬ l¬¤ ¤¬ Index Record (·i¤i n¤i r ni ·ii Index - 10,000 Records ¬i --iº ¬º·i ¤·ni+
Index Records Data Records ¬ si- rin r ¬n ¤r -i· ¬n r l¬ ¤¬ Block - 100 Records ¬i ºªii n¤i r+
¬n Index ¬i 100 blocks ¬i ¬i(’¤¬ni rini n·ii :· Indexes ¬i Disk ¤º Sequential File ¬ ª¤ - Store l¬¤i
¬ini r+
¤l( Index ¬i ¬i: ¬ si-i ri ( ¬¬ Main Memory - ºªii ¬i¤ ni Indexing riºi Records Search¬º· - ¬- ¬-¤
¬nni+ ( ¤l( Index (·i r ni ¬¬ Disk ¤º ºªii ¬i¤ni l¬¬¬ Disk Block Read ¬º· - ¬-¤ ¬l·i¬ ¬nni+ ¬n
:¬¬ l¬¤ Binary Search ¬i ¬¤¤in - l¬¤i ¬ini r+
¬n :¬ ¬--¤i ¬i (º ¬º· ¬ l¬¤ Primary Index ¤º ¤ · Sparse Index (·i¤i ¬ini r+ l¬¬¬ File ¤º (i Index
Create rin r ÷
(1) Inner Index
(2) Outer Index
BIKANER
CALCUTTA
DELHI
MADRAS
BIKANER

MADRAS

RURKI
Database Management Systems
Developed By SMS (The best friends group) 25
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
:¬ ¤¬iº ¬( Indexing ¬ l¬¤ (i levels ¬i Create l¬¤i ¬ini r ( ¬·- ¬ l¬¬i ¬i(’¤¬ Block ¬i ri
Read l¬¤i ¬ini r ni :¬ ¤¬iº ¬i Indexing ¬i Two-level Indexing ¬rn r+ :¬- Outer Index ¬i Main
Memory - ºªii ¬ini r+ ¤l( Outer Index (·i ri ni ¬¬¬i ¤ · Indexing ¬º (i ¬ini r ( ¬(¬ ¬n - (· Index
¬i Main Memory - ºªii ¬ini r+ :¬ ¤ ¬iº ¬i Indexing ¬i Multi-lelvel Indexing ¬ri ¬ini r +
















SECONDARY INDEX

¬( Multilevel Index ¬i ¬¤¤in - l¬¤i ¬ini r ni, Index level ¬i l·-· ¤¬iº ¤lº·iil·in l¬¤i ¬ini r+
(1) Inner Index (Primary Index)
(2) Outer Index (Secondary Index)
Secondary Index r-’ii Dense ri·i ¤ilr¤+ l¬¬- rº Search Key Value ¬i Index Entry ¬i ºªii ¬ini r
( ¬i·i ¬i·i rº Record Pointer ¬i ·ii ºªii ¬ini r + Primary Index Sparse Index ri ¬¬ni r l¬¬- ¬ s Search
Key Values ¬i ri --iº l¬¤i ¬ini r+
Secondary Index ¬ riºi Query Performance ¬i ¬·iiºi ¬ini r l¬¬- Primary Index ¬i Search Key
Values ¬i ¬¤¤in - l¬¤i ¬ini r+

A-No. BRANCH Amount
A-101 DELHI 500
A-217 BOMBAY 750
A-110 DELHI 600
A-215 MADRAS 700
A-102 PILANI 400
A-201 PILANI 900
A-218 RURKI 700
A-222 RAJKOT 700
SECONDARY INDEX
B+ TREE INDEX FILES:- Index Sequetial file Organization ¬i - ª¤ ri·i ¤r r l¬ ¬ ¬÷z File -
Records («n r ( ¬÷z :¬ File Organization ¬i Performance level ¬- rini ¬ini r+
¬n :¬¬ l¬¤ B+ Tree Index Structure ¬i ¬¤¤in - l¬¤i ¬ini r l¬¬¬ ¤i: ¬ - Records ¬i Insertion (
deletion ¬i¬i·i ¬ l¬¤i ¬i ¬¬ni r+ B+ Tree Index ¤¬ Balanced Tree ¬i Form - ºrni r l¬¬- Root ¬
Leaf n¬ rº Path ¬i ¬-(i: ¬i-i· rini r+

Data
Block 0
Data Block 1
2
(Inner Index)
On Disk
(Outer Index)
Main Memory
Database Management Systems
Developed By SMS (The best friends group) 26
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
B+ Tree Structure Insertion ( deletion ¬¤lº·¤¤ ¬i ni Remove ¬º (ni r ¤º·n Space Overhead ¬i Add ¬º
(ni r ¤º·n ¤r ¬¤lº·¤¤ ¬·¤ ¬¤lº·¤¤i ¬ ¬l·i¬ ¬¤¤ ·n r+ ·¤il¬ :¬¬ File Organization ¬i Performance Level
(« ¬ini r+ B+ Tree Structure ¬i Index ¬ ¬i·i ¬i·i File Record ¬ Organizer ¬ ª¤ - ¬¤¤in - l¬¤i ¬ini r+
:¬- B+ tree ¬ leaf Nodes - Pointers ¬ -·ii· ¤º Record ¬i Store l¬¤i ¬ini r+















B+ Tree File Organization

B+ Tree - leaf node - nonleaf Node ¬ Point ¬ ¤¬ ¬- Records ¬i ºªii ¬ini r+ B+ Tree Index ( B+
Tree File Organization (i·i - Insertion ( deletion ¤¬ ri ¤ ¬iº ¬ l¬¤i ¬ini r+ ¤l( l¬¬i B+ Tree ¬i
¤lº·iil·in l¬¤i ¬i¤ ni l·-· (ini ¬i ·¤i· - ºªi·i ¬i(’¤¬ r÷
(1) ¤l( n ¬i Value (i n: r ni ¬¬- N-1 Value ( N Pointers ¬i ºªii ¬i¤ni ¬ ¬÷
¤l( N=3 ri ( Search Key Branch Name r ni ¤¬ Node - N-1 Values n·ii N= 3 Pointers ¬i Store l¬¤i
¬i¤ni+















B-Tree Index Files:- B-Tree Index l(~¬ ¬ B+ Tree Index ¬i nºr ri rini r + (i·i Index Files - - ª¤ ¬·nº
¤r r l¬ B-Tree Index - Search Key Values ¬i Redundaut (Duplicate) Values ¬i Remove ((º) ¬º l(¤i
¬ini r+
B Tree ¬ riºi Search Key Values ¬i ¤¬ (iº ri ¤ (l’i n l¬¤i ¬ini r+ leaf node l(~¬ ¬ B+Trees ¬i nºr rini
r+
I
C F K M
A,4 B,8 C1 D5 E4 F7 G3 H3
I4 IB
K1 L6 M4 H8 P6
Val1 Val 2
1 Pointer 2
nd
Pointer 3
rd
Pointer
Bombay y Delhi z

A-212 Bombay
A-101 Delhi
A-110 Delhi
Leaf Node
Database Management Systems
Developed By SMS (The best friends group) 27
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
Static Hashing:- Sequential File Organization ¬i ¤¬ ¬-i ¤r r l¬ ·i-i ¬i Search ¬º· ¬ l¬¤ Index
Structure ¬i Access l¬¤i ¬ini r ( :¬¬ l¬¤ Binary Search ¬i ¬¤¤in - l¬¤i ¬ini r+ l¬¬¬ ¬l·i¬
Input/Output Operations ¬i Perform ¬º·i ¤·ni r+
¤º·n ¬( File Organization, Hashing n¬·i¬ ¤( l··iº ¬ºni r ni :¬¬ ¬l·i¬ I/O Operation ¬i ¬i(’¤¬ni ·ri
rini+ Hashing ¬ riºi ·ii Index ¬i (·i¤i ¬ini r+

Hash File Organization:- :¬ Organization - Record ¬i Search Key Value ¤º ¤¬ Function (¤·’i·)
Perform l¬¤i ¬ini r+ l¬¬¬ ¬i(’¤¬ Disk Block ¬ ¬i(’¤¬ Record ¬i ¬i¬i·i ¬ Search ¬º l¬¤i ¬ini r+
Hashing ¬ ¬·nn n Bucket Keyword ¬i ¬¤¤in - l¬¤i ¬ini r+ l¬¬- ¤¬ ¤i ¤¬ ¬ ¬l·i¬ Records ¬i Store ¬º
ºªii ¬ini r+ ¬n Bucket ¤¬ Disk block ¬ ¬i r + ¬l¬· ¤r ¤¬ Disk Block ¬ si-i ¤i (·i ri ¬¬ni r+
-i·i K ¬ riºi ¬·ii Search Key Values ¬i ¤ (l’i n l¬¤i ¬ini r n·ii B riºi ¬·ii Bucket Address ¬i ¤ (l’i n ¬ºni
r+ Hash Function h ¤¬ Function r l¬¬¬ riºi K Search Key Values ¬ B Bucket ¬ Specific Record ¤º
¤r ¤i ¬ini r+
l¬¬i Record ¬i ¬¬¬i Search Key (k1) ¬ ¬i·i Store ¬º· ¬ l¬¤ ¬¬ ¤º h (Hash Function) (ki) ¤º¤i- l¬¤i
¬ini r+ ¬i Record ¬ Bucket Address ¬i Return ¬ºni r+
:¬ ¤ ¬iº Records ¬i ¬¤ºi·n l(l·i riºi Delete ·ii l¬¤i ¬i ¬¬ni r +

Hash Function:- ¬(¬ (¬iº Hash Function (r r l¬¬- ¤¬ ri Bucket - ¬·ii Search Key Value ¬i ºªii ¬ini
r+ l¬¬¬ l¬¬i ·ii Record ¬i ««· ¬ l¬¤ ¤ºi Bucket Record ¬i Search ¬º·i ¤·ni ri+
¤¬ ¬·si Hash Function (ri r l¬¬- Key Values ¬i ¬·ii Bucket ¤¬ ª¤ - Store l¬¤i ¬i¤+ ¬·iin ¬·ii
Buckets - ¤¬ ¬-i· Records ¬i Store l¬¤i ¬i¤+ ¬n rº Bucket - Records ¬i -i¤i ¬-i· rini r+
¬n Design time ¤º User ·ri ¬i·ni l¬ l¬¬ Search Key Values ¬i File - ¬ri --iº l¬¤i n¤i r + ¬n Search
Key Values ¬i Bucket - ºªi· ¬ l¬¤ Hash Function ¬i ¬¤¤in l¬¤i ¬ini r + Buckets - Search key Values
¬i distribution (l(nººi) l·-· ¤ ¬iº l¬¤i ¬ini r ÷
(1) l(nººi Uniform ri·i ¤ilr¤ (¬-i·)
(2) l(nººi Random (¬¬-i·) ·ii ri ¬¬ni r +

Bucket Overflow:- ¬( Record ¬i Insert l¬¤i ¬ini r ni Bucket - ¬¬ Record ¬ l¬¤ Space ·ii ¬i ¬ini r+
¤º·n ¤l( Bucket - ¬i(’¤¬ Space ·ri r ni Bucket Overflow ¬i ¤lºl-·iln ¬-¤·· rini r + Bucket Overflow
(r n ¬ ¬iººii ¬ ¬-¤·· rini r ¬i l·-· r÷
(1) Insufficient Buckets:- (¬( ¤ºi ª¤ ¬ Buckets ¬¤¬··i ·i ri)÷ Buckets (nB) r-’ii nr/fr ¬ ¬l·i¬ ri·i
¤ilr¤+ ¤ri nr- ¬·ii Records l¬·r Store ¬º·i ri+ fr- ¤¬ Bucket - fit ri· (i¬ Records ¬i ¬ª¤i ¬n nB ¬(
nr/fr ¬ ¬l·i¬ rini n·ii Bucket Overflow ¬i ¬--¤i ¬i r-i¤i ¬i ¬¬ni r+
(2) Skew ¼Ld;w½%& ¬ s Buckets - ¬·¤ Bucket ¬i ¬¤·ii ·¤i(i Records ¬i Store ¬º l(¤i ¬ini r ¬(l¬ (¬ºi
Buckets - Space (¤i rini r + :¬ ¤¬iº ¬i Condition ¬i Skew ¬ri ¬ini r+ Skew - ª¤n (i ¬iººii ¬ ¬-¤··
rini r÷
(·) ¬( (r n ¬ Records ¬i ¤¬ Search ¬i ri+
(z) ¬( Hash Function riºi Search Keys ¬i ¬¬-i· l(nººi l¬¤i ¬i¤+

Overflow ¬i ºi¬· ¬ l¬¤ ¤r ¬i(’¤¬ r l¬ ¬·¤ Buckets ¬i Allocate ¬º l(¤i ¬i¤ Bucket Overflow ¬i
Overflow Bucket riºi ·ii (º l¬¤i ¬i ¬¬ni r+ ¬ ¬÷ ¤l( Record ¬i Bucket b - Store ¬º·i r ( b ¤r¬ ¬ ¤ºi
ri ¤ ¬i r ni System riºi b ¬i Oveflow Bucket ( (i ¬ini r n·ii Record ¬i Overflow Bucket - Insert ¬º
l(¤i ¬ini r+ ¤l( Overflow Bucket ·ii Full ri ¬i¤ ni System riºi ¬·¤ Overflow Bucket Provide ¬º(i (i
¬ini r+ :¬ ¤ ¬iº ¤r ¬- ¤¬ni ºrni r+ ¬·ii Overflow Buckets ¬i ¬¬ Bucket ¬ ¬i·i Link list ¬i nºr Store
¬º l(¤i ¬ini r + :¬ ¤ ¬iº ¬i List ¬i Overflow Chaining ¬ri ¬ini r+

Database Management Systems
Developed By SMS (The best friends group) 28
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945










HASH INDICES:- Hasing ¬i File Organization ¬ ¬i·i÷¬i·i Index-Structure ¬ l¬¤ ·ii ¬¤¤in - l¬¤i ¬i
¬¬ni r+ hash index ¬ riºi Search Key ¬i ¬¬¬ Pointer ¬ ¬i·i Hash File Structure - Store l¬¤i ¬ini r+
Dynamic Hashing:- ¬( Bucket b - Fix Address ¬i ºªii ¬ini r + Static Hashing ¬ ¬-¤ ¬·ii ¬·ii Serious
Problems Occur ri ¬ini r+ ¬n :¬ ¤ ¬iº ¬i Condition Occur ·i ri :¬¬ l¬¤ l·-· Option ¬i ¬¤¤in - l¬¤i
¬ini r÷
(1) Current File Size ¬ ¬i·iiº ¤º Hash Function ¬i ¤ ··i
(2) ¬¬ Hash Function ¬i ¤ ··i ¬i Current File ¬ ¬i·i ¬i·i ¬lnlº·n Space ¬i ·ii Consider ¬º l¬¬¬
Performance ·ii («ni r ¤º·n Space ¬l·i¬ Waste rini r+
(3) File Growth ((«·) ¬ ¬i·i ¬i·i Hash Structure ¬i ·ii ¤ · Reorganize ¬º·i ¤r Operation time
Consuming ni r+ ¤º·n Accessing ¬ l¬¤ ¬i(’¤¬ ·ii r+
Dynamic Hashing l(l·i¤i ¬ riºi Hash Function ¬i Database ¬ («· ¤i ¬- ri· ¬ ¬i·i÷z ¤lº(ln n
l¬¤i ¬i ¬¬ni r+ ¬·ii n Hash Function Database ¬i Growth ¬i ni ·ri ((¬ ¬¬ni ¤º·n Growth ¬ ¬i·i ¬i·i
Hash Function ¬i ¤lº(ln n l¬¤i ¬i ¬¬ni r +
INDEX DEFINITION IN SQL:- Index Database ¬i Efficient Processing ¬ l¬¤ ¬i(’¤¬ rin r
l¬¬- Transaction ¬i Update l¬¤i ¬ini r+ ( ¬· ¤º Queries ·ii Perform ¬i ¬ini r + SQL - Index Create
¬º· ¬ l¬¤ Create Index Command ¬i ¬¤¤in - l¬¤i ¬ini r+
Syntax:- Create index <index_name> on
<relation_name> (<attributes>) Attributes - ¬· Columns ¬i ºiil-¬ l¬¤i ¬ini r l¬· ¤º Index
Create ¬º·i ri+


Bucket 0
Bucket 1
Bucket 2
Overflow Buckets for Bucket 1
Database Management Systems
Developed By SMS (The best friends group) 29
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
UNIT-V
FALIURE CLASSIFICATION:- (System esa gksus okys Faliure ds Hkkx):- System - ¬: ¤ ¬iº ¬ Faliures
rin r + ¤º·n ¬(¬ Simple Faliure (r r l¬¬¬ l¬¬i ·ii ¤ ¬iº ¬i Information ¬i Loss ·i ri+ ¤º·n l¬·-
Information Loss rini r+ ¬¬¬ (r n - l’¬¬ ¬ Recovery ¬i ¬ini r+ - ª¤n ¬-¤·· ri· (i¬ Faliures l·-· r ÷
(1) Transaction Faliure:- l¬¬i ·ii Transaction ¬ Fail ri· ¬i ¬iººi - ª¤ (i Errors ri ¬¬ni r ÷
(1) Logical Error:- ¬( Transaction ¬i Execution ¬l·i¬ ¬-¤ n¬ l¬¬i Internal (¬inlº¬) Condition
¬ ¬iººi Normal · ºr ¤i¤ ni ¤r Logical Error ¬r¬ini r+ ¬ ¬÷ Data ¬i ·i l-¬·i , Data ¬i Oveflow ri·i
¬il(+
(2) System Error:- ¬( System l¬¬i ¬·¤iri l-·iln ¬ ¬ dead lock ¬i l-·iln - ¬i ¬i¤ ( :¬¬
Transaction Normal Execution - · ºr ni :¬ ¤¬iº ¬i Error ¬i System Error ¬ri ¬ini r+
(2) System Crash:- ¬( Hardware, Database Software ¤i Operating System - Error ¬i ¬i¤ l¬¬¬
Volatile Storage ¬i Information ¬ ºl·in ·i ºr ni :¬¬ ·ii Transaction ª¬ ¬ini r+
(3) Disk Faliure:- Head ¬ Crash ri· ¤i Disk Block ¬ ªii ¬i· ¬ Data Transfer Operation ¬ ¬i·i ¬i
Faliure ¬-¤·· rini r ¬¬ Disk Faliure ¬ri ¬ini r+
¬n ·i-i(¬ - Consistency (·i¤ ºªi· ( Failure ¬ Recovery ¬ ¬ s Techniques (l(l·i¤i) ¬¤·i: n: r
l¬·r Recovery Alogrithm ¬ri ¬ini r+ ¤ - ª¤n (i ¤¬iº ¬ rin r ÷
(1) Normal Transaction Processing ¬ l¬¤ ¬¤¤ ·n Iformation ¬i ri·i nil¬ Recovery ¬i¬i·i ¬ ri ¬¬+
(2) Faliure ¬i Recover ¬ºn ¬-¤ Database ¬i Consistent ( Atomic (·i¤ ºªin r+

STORAGE STRUCTURE
Storage Media ¬i ¬¬¬i Speed ·i-ni ¬ ¬i·iiº ¤( ¤lº·iil·in l¬¤i ¬ini r+ ¬n -ª¤n Storgae (i ¤ ¬iº ¬ rin r ÷
(1) Volatile Storage
(2) Non-Volatile Storage

(1) Volatile Storage:- System Crash ¬ (i ºi· Volatile Storage - ºªii n: Information ·ri r-ni r+ Main
Memory ¤i Cache Memory :¬ Storge ¬ - ª¤ ¬(irººi r+ Volatile Storage ¬ ·i-i ¬i Fastly Access
l¬¤i ¬ini r+
(2) Non-Volatile Storage:- System Crash ¬i Non-Volatile Storage ¤º ¬l·i¬ ¤ ·ii( ¤·ni r+ Non-Volatile
Storage, Volatile Storage ¬i ¬¤·ii Slow rin r ·¤il¬ Disk ¤i Tape (Non-Volatile Storage) Electro
Mechanical (:¬·-i- ¬l·¬¬) r ¬(l¬ Volatile Storage Chips ¬ (· rin r +
Stable Storage:- Stable Storage - ºªii n: Information ¬i Loss ·ri rini r +

TRANSACTION MODEL
Transaction ¤ in i- Execution ¬i ¤¬ ¤l·- r l¬¬¬ riºi l(l·i·· Data Items ¬i Access ( Update l¬¤i
¬i ¬¬ni r+ User riºi Execute ¬i ¬i· (i¬i ¬·ii Transactions ¤i Statements ¬i Begin Transactoin ( End
Transaction ¬ (i¤ ºªii ¬ini r+ ¬n Database System - l¬¬i ·ii Transaction ¬i Properties ¬i Follow l¬¤i
¬i·i ¬i(’¤¬ r÷
(1) Atomicity ¼,VkWfeflVh½:- Transaction - ri· (i¬ ¬·ii Operations, Database - ¬i¤÷z ¤ (l’i n ri·
¬i(’¤¬ r+
(2) Consistency:- ¬( Database - ¬i: ¤¬ Transaction Execute ri ºri ri ni (¬ºi Transaction Execute
·ri ri·i ¤ilr¤ l¬¬¬ Database - Consistency (·i ºrni r+
(3) Isolation:- ¬( Database - Multiple Transaction Execute ri ºri ri ni ¤r¬i Transaction ¬ ªi-- ri·
¤º ri (¬ºi Transaction ¬i Execute ri·i ¤ilr¤+
(4) Durability:- ¬( ¤¬ Transaction ¤ºi Execute ri ¬i¤ n·ii ¬¬¬ ¬(l·in Updates ¬i Database - l¬¤i
¬i·i ¤ilr¤+
¬¤ºi·n ¬·ii Properties ¬i ACID Properties ¬ri ¬ini r+
Database Management Systems
Developed By SMS (The best friends group) 30
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945


l·-· (i Operations ¬ riºi ¬i: ·ii Transaction Data ¬i Access ¬º ¬¬ni r÷
(1) Read (x)
(2) Write (x)

Read (x) Operation ¬ riºi Data item x ¬i Database ¬ Local Buffer - Send l¬¤i ¬ini r+

Read – Database Local Buffer

Write (x) Operation riºi Data Item x ¬i Local Buffer ¬ ¤ · Database - Send l¬¤i ¬ini r+

write – Database Local Buffer

TRANSACTION STATE:- Faliure · ri· ¤º ¬·ii Transaction ¬¤¬ni¤(¬ ¤ºi ri ¬in r+ ¬( Trasaction
¬¤¬ni¤( ¬ Complete ·ri rini ni :¬ ¤ ¬iº ¬i Transaction ¬i Aborted Transaction ¬ri ¬ini r +
Aborted Transaction riºi l¬¤ n¤ Changes ¬i ¬( Reject ¬º Transaction ¬i ¤( l-·iln - ¬i·i
Transaction Rollback ¬r¬ini r +
¬( Transaction ¬¤·i Execution ¤ºi ¬¤¬ni¤(¬ ¬º ¬ni r ni ¬¬ Transaction ¬i Commit ri·i ¬rn
r+
¬n ¬i: ·ii Transaction l·-· - l¬¬i ·ii ¤¬ State - ri·i ¤ilr¤÷
(1) Active:- ¤ iºl-·i¬ State, ¬( Transaction Execute ri ºri ri+
(2) Partially Committed:- ¬( Transaction ¬i Last Statement Execute ri+
(3) Failed:- ¬( ¤r ¤ni ¬n ¬i¤ l¬ ¬( Transaction ¬i Normal Execution ¬·i( ·ri+
(4) Aborted:- ¬( ¬¤¬ni¤( ¬ Execution ·i ri+
(5) Committed:- ¬( Transaction ¬i Execution ¬¤¬ni¤(¬ ri ¬i¤+
LOG BASED RECOVERY:- Database - ri· (i¬ ¤lº(n ·i ¬i Store ¬º· ¬i ¬(¬ -r-(¤ºi nºi¬i Log r +
Log - Log Records ºªi ¬in r+ - ª¤n Log record - l·-· Fields ¬i ¤lº·iil·in l¬¤i n¤i r÷
(1) Transaction Identifier:- ¼VªkWtsD’ku vkbMsfUVQk;j½ ¤r Transaction ¬i ¤¬ Identifier r l¬¬¬ riºi
Write Operation Perform l¬¤i ¬ini r+
(2) Data Item:- ¤r Data Item ¬i Disk ¤º l-·iln ¬i ¤ (l’i n ¬ºni r+
(3) Old Value:- Data Item ¬i ¤ ºi·i Value Write ¬º· ¬ ¤r¬ (i¬i+
(4) New Value:- Data Item ¬i ·¤i Value (Write ¬º· ¬ (i( ¬i Value)
Log Record ¬i Values ¬i l·-· ¤ ¬iº ¬ ¤ (l’i n l¬¤i ¬ini r+
(1) Ti <Start> - Ti – Transaction
Transaction ¬i Execution ¤ iº-·i ri· ¤º Log Record - Entry.
(2) <Ti, xj, V
1
, V
2
– ¬n Transaction riºi Xj data Item ¤º Operation Perform ¬º·i+
V
1
– xj data item ¬i Old Value
V
2
– Xj Data Item ¬i New Value
(3) <Ti Commit> - Transaction ¬ Commit ri· ¤º+
(4) <Ti Abort> - Transaction Ti ¬ Abort ri· ¤º+
¤ Log Records System ¤i Disk Faliure ¬ ¬-¤ Data Recovery - ¬ri¤ni ¤ (i· ¬ºn r + ¤ Log
Stable Storage - Store l¬¤ ¬in r+ Transaction ¬i Atomicity ¬i (·i¤ ºªi· ¬ l¬¤ l·-· (i ¤ ¬iº ¬ Log
Records Maintain l¬¤ ¬i ¬¬n r÷
Log Records - ¬·ii Database Transaction ¬i ¤ºi Record ºªii ¬ini r+
Data Item
Data Item
Database Management Systems
Developed By SMS (The best friends group) 31
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
(1) Deferred Database Modification:- :¬ n¬·i¬ - Database Updation n·ii l¬¤ ¬in r ¬( Log
Record Partially Commit ·i ri ¬i¤+
(2) Immediate Modification:- :¬- Transaction ¬ Active State ¬ ¬i·i÷¬i·i ri Database - Updation
¬º l(¤ ¬in r+ ¤ Recovery Scheme (i ¤ ¬iº ¬ Recovery Procedure (¤ i¬i¬º) ¬i Follow ¬ºni r ÷
(1) Undo (Ti) – ·¤i Value ¬i ¤ ºi·i ¬ Replace
(2) Redo (Ti) – Data Item ¬i ·¤i Value Set ¬º·i+

Check Points:- ¬( System Failure rini r n( Recovery ¬ l¬¤ Log ¬i ¤ ¬ l¬¤i ¬ini r n·ii (i( -
Transaction ¬i Undo ( Redo l¬¤i ¬ini r + ¤º·n Log Records ¬ Information Access ¬ºn ¬-¤ (i - ª¤
Problems ¬ini r ¬i l·-· r ÷
(1) Records ¬i ««· - ¬-¤ ¬l·i¬ ¬nni r+
(2) ¬ s ¤¬i Transaction l¬·r Update ¬º l(¤i n¤i r ( ·ii Log Records - ºiil-¬ rini r l¬¬¬ Recovery
- ¬-¤ ¬l·i¬ ¬nni r+
:¬ ¤ ¬iº ¬ ¬¤lº·¤¤i ¬i r-i· ¬ l¬¤ Check Points ¬ Concept ¬i n ¤iº l¬¤i n¤i+
(1) ¬·ii Log Records ¬i Stable Storage ¬ Main Memory - ¬i·i
(2) ¬·ii Updated Buffer Block ¬i ¤¬ nº¤ ¬º·i+
(3) Stable Storage - ¬¤ºi·n Log Record ¤º Check Point (¤¬¤i:·-) ¬ni·i+

BUFFER MANAGEMENT
(1) Log-Record Buffering
(2) Database Buffering
¤l( System - Data Transfer Faliure Occur r ¬i r ni System :¬¬ l¬¤ Recovery Procedure (lº¬(ºi
¤ i¬i¬º) ¤¬ini r+ l¬¬¬ Database ¬i ¤ · Consistent State - ¬i¤i ¬ini r + :¬¬ l¬¤ System Database ¬ rº
Block ¬ l¬¤ (i Physical Block n ¤iº ¬ºni r l¬·r ¤¬ ri -·ii· ¤º ºªii ¬ini r+ ¬( Database ¤º Operation
l¬¤i ¬ini r ni l·-· Steps ¬i Follow l¬¤i ¬ini r÷
(1) ¬(¬ ¤r¬ Information ¬i ¤r¬ Block - Store ¤i Write l¬¤i ¬ini r+
(2) ¬( First Write Operation ¬¤¬ni¤(¬ ¤ºi ri ¬ini r n( :¬i Information ¬i Copy Second Block -
¬º (i ¬ini r +
(3) :¬ ¤ ¬iº Second Block ¤º Information Copy ¬º· ¬ (i( ri Operation Complete rini r +
(1) Log Record Buffering:- r- ¬i·n r l¬ rº Log Record ¬( Create rini r ni ¬¬ Stable Storage - --iº
¬º l(¤i ¬ini r + ¤º·n (r n ¬ ¬¤lº·¤¤ ·ii :¬ Storage - ºiil-¬ rin r ¬ ¬÷ Stable Storage ¬i Blocks - (i-i
¬ini r ( - ª¤n Log Records ¬ Size ¬· Blocks ¬ (r n ¬- rini r l¬¬¬ Memory Block ¬i ¬ s ·iin ªii¬i ri
ºr ¬ini r+
¬n :¬¬ l¬¤ ¬i(’¤¬ r l¬ ¤¬÷¤¬ Log Record ¬i Stable Storage - · ºªi¬º ¤¬ Block Size ¬ Log
Records ¬i ¤¬ ¬i·i :¬--i ¬º l¤º ¬¬ Stable Storage - Store l¬¤i ¬i¤+ ¬n :· ¬·ii Log Records ¬i ¤¬
¬i·i :¬- -i ¬º· ¬ l¬¤ Main Memory - Buffer Allocate ¬º (i ¬ini r+
:¬ Buffer ¬i Log Buffer ¬ri ¬ini r+ ¬n ¤¬ ¬i·i ¬·ii Log Records ¬i Block Size ¬ ¬i·iiº ¤º
Buffer - ¤¬l¤n ¬º l¬¤i ¬ini r n·ii (i( - ¬¬ Stable Storage ¬ Block - --iº ¬º l(¤i ¬ini r+ :· Log
Records ¬i Stable Storage - ¬¬i ¬- - --iº l¬¤i ¬ini r l¬¬ ¬- - ¤ Records Log Buffer - rin r +
Log Buffering ¬ ¬iººi Log Records ¬i l¬¤ Main Memory - ¬ s ¬-¤ ¬ l¬¤ ºªii ¬ini r n·ii (i( -
¬·r Stable Storage - Store ¬ºn r + ¤º·n ¤l( Main Memory - Log Records ¬i ºªii n¤i r ( System Crash
ri ¬ini ri :¬ l-·iln ¬ l·-· Recovery Procedure (¤ i¬i¬º) ¬i ¬¤·i¤i ¬ini r ÷
(i) ¬i: ·ii Transaction (- i¬·’i·) ti n·ii Commit State - ¬i¤ni ¬( <Ti Commit> Log Record ¬i
Stable Storage - l¬ªi l(¤i ¬i¤+
(ii) <Ti Commit> Log Records ¬i Stable Storage - ºªi· ¬ ¤r¬ ti ¬ ¬(l·in ¬·ii Log Records ¬i
Stable Storage - l¬ªi l(¤i ¬i·i ¤ilr¤+
Database Management Systems
Developed By SMS (The best friends group) 32
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945
(iii) Data Operations ¤i Log Records ¬i Database - Write ¬º· ¬ ¤r¬ ¬·ii Log Records ¬i
Stable Storage - ri·i ¬i(’¤¬ r+
:¬ l·¤- ¬i (WAL) Write Ahead Logging ¬ri ¬ini r+
Buffered Log ¬i Disk ¤º Write ¬º·i Log Force ¬r¬ini r +
Database Buffering:- System Database ¬i Nonvolatile Storage - Store ¬ºni r n·ii ¬( ·i-i(¬ -
Operation ¬º· ri ni l¬¬i Specific Data Block ¬i ¬i¤i ¬i Main Memory - ¬i¤i ¬ini r+ ·¤il¬ Database
¬i ¬¤·ii Main Memory (r n si-i rini r+ ¬n ¤r ¬i(’¤¬ r l¬ l¬¬i (¬º Block ¬i Memory - ¬i· ¬ ¤r¬
¤r¬ Block ¬i ¤ · Disk ¤º Write ¬º l(¤i ¬i¤+ ¬n Block b1 ¤º ¤l( Operation Perform ri ¤ ¬i r ni ¤r¬
b1 Block ¬i (irº ¬º Block b2 ¬i Main Memory - ¬i¤i ¬i¤ni+ :¬¬ l¬¤ Virtual Memory Concept ¬i
¬¤¤in - l¬¤i ¬ini r+ :¬¬ l¬¤ l·-· Steps - Operation Perform l¬¤ ¬in r ÷
(1) b1 ¬ ¬(·iin ¬·ii Log Records ¬i Stable Storage - Store ¬º·i+
(2) Block b1 ¬i Disk ¤º l¬ªi·i+
(3) Block B2 ¬i Main Memory - ¬i·i+
¤º·n ¤l( Block b1 ¬ riºi Block b2 ¬i Call l¬¤i ¬ini r ni ·ii B1 ¬ ¬·ii Output ¬i Buffer Use -
¬¬º Stable Storage - ºªi l(¤i ¬ini r n·ii (i( - Block B2 ¬i main Memory - ¬i· l¬¤i ¬ini r ¬( b2 ¬i
¬i¤ ¤ºi ri ¬ini r ni ¬¬¬ Output ¬i Stable Storage - ºªi b1 ¬i Execute l¬¤i ¬ini r ( ¬n - Blocks ¬i
Disk ¤º l¬ªi l(¤i ¬ini r+
SHADOW PAGING
(1) Recovery ¬i ¤¬ ¬·¤ l(l·i r l¬¬ Shadow Paging ¬ri ¬in r +
(2) :¬ Technique - Database ¬i Fixed length bbcks - (i-i ¬ini r l¬·r Pages ¬rn r + (Pages
Operating System ¬i Concept r l¬¬ Memory Management ¬ l¬¤ ¬¤¤in - l¬¤i ¬ini r +
(3) -i·i l¬ Database ¬i 1 ton Pages - (i-i n¤i r ¤º·n ¤ Page disk ¤º l¬¬i Order (¬-) - ·ri r +
(4) ¤l( Database ¬ l¬¬i ¤¬ ¤º Operation ¬º·i ri ni ¬¬ ¤¬ n¬ Page Table ¬ riºi ¤r ¤i ¬ini r+
(5) Page Table - N Entries rini r+ rº Entry Database ¬ ¤¬ Page ¬i ¤ (l’i n ¬ºni r+
(6) rº Entry ¬ ¬i·i Pointer ·ii rini r ¬i Disk ¤º Page ¬i Point ¬ºni r+
(7) ¤r¬i Entry Database ¬ ¤r¬ ¤¬ ¬i ¤ (l’i n ¬ºni r ( Second Entry (¬º ¤¬ ¬i ¤ (l’i n ¬ºni r+
(8) Shadow Paging n¬·i¬ ¬i - ª¤ Idea ¤r r l¬ :¬- (i Page Tables ¬i Maintain l¬¤i ¬ini r ÷ (1)
Current Page Table (2) Shadow Page Table
(9) ¬( ¬i: Transaction Perform ¬i ¬ini r (i·i Page Tables - Same Entries rini r+ Shadow Page
Table Transaction ¬ (i ºi· ¬·ii Change ·ri rini+
(10) ¤º·n Current Page Table Transaction ¬ Write Operation ¬ (i ºi· Change rini ºrni r+
(11) ¬·ii Input n·ii Output Operation ¬ l¬¤ Current Page Table ¬i ¬¤¤in - l¬¤i ¬ini r +

-i·i l¬ Transaction Ti Write (x) Item Operation Perform ¬º·i ¤irni r n·ii X Data Item l¬¬i ith Page ¤º
¤·i r+ System riºi Write (x) Operation l·-· ¤ ¬iº Perform l¬¤i ¬ini r ÷

(1) ¤l( ith Page (l¬¬- X data Item Stored r ) Main Memory - ·ri r ni System riºi ¬(¬ ¤r¬ Input
(x) Operation Perform l¬¤i ¬ini r+
(2) ¤l( Transaction riºi :¬ ith Page ¤º ¤r¬i Write Operation Perform l¬¤i ¬i ºri r ni System
Current Page Table ¬i l·-· ¤¬iº ¬ Change ¬ºni r÷
(i) ¬(¬ Disk ¬ ¤¬ Unused Page ¬i l¬¤i ¬i¤ni+ (- ª¤n Database ¬ ¤i¬ free Pages ¬i List rini r )
(ii) :¬ Free Page ¬i Entry ¬i Database ¬i Free Page List - ¬ r-i·i ( ith Page ¬ Data ¬i ·¤ ¤¬ ¤º
¬i¤i ¬º·i+
(iii) ¬( Current Page Table - ¬¬ ith Page ¬i Entry ¬ l¬¤ ·¤ ¤¬ ¬ Pointer ¬i Allocate ¬º l(¤i
¬i¤ni+ l¬¬ ¤( ith Page ¬i ¬i¤i ¬i n: ·ii+ ¬( X ¬i ·: Value xj ¬i buffer - ºªi l(¤i ¬ini r+

Database Management Systems
Developed By SMS (The best friends group) 33
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945



















Shadow Page Table ¬i Disk ¤º Store l¬¤i ¬ini r+l¬¬¬ transaction execution state ¬i Recovery ¬i ¬ini
r + ¬( transaction Commit ri ¬ini r ni System riºi ¬¬ Current Page Table ¬ Disk ¤º Store ¬º l(¤i ¬ini
r+ ¬n Current Page Table riºi ·¤i shadow Page Table (·i (i ¬ini r+ :¬ ¤ ¬iº Current Page Table Main
Memory - --iº ºrni r ( Shadow Page Table Disk ¤º+ ¤l( Crash ¬ (i ºi· Current Page Table Lost
(destroy) ri ¬ini r ni System riºi Shadow Page Table ¬ Recovery ¬º ¬i ¬ini r + ¬i º ¬¬i Shadow Page
Table ¬i Copy ¤ · Main Memory - ¬º Current Page Table (·i (i ¬ini r+




1
2
3
4
n
.
.
.
.
.
.
.
.
Page Table
Simle Page Table
Pages on disk
1
2
3
4
5
6
7
1
2
3
4
5
6
7
Shadow Page Table
(Disk)
Page disk
Current Page Table
(Main Memory)

Database Management Systems Bachelor of Computer Application (BCA) Examination, December 2005 2BCA3 - DATA BASE MANAGEMENT SYSTEM Unit I 1. gkfLiVy dk ,d E-R ekMy cukb;s ftlesa MkWDVj yksxksa dk ,d leqPp; gks vkSj jkfx;ksa dk ,d leqPp; gks] izR;sd jksxh dk VsLV jksxksa ds lkFk Association n’kkZb,A Draw an E-R diagram for the database of hospital with a seat of patients and set of a Medical Doctors with each patients a log of the various tests conducted is also associated. 20 2. ¼v½ Recursive lEcU/k dk D;k eryc gSa \ dqN mnkgj.k nsdj le>kb;sA What is meant by a Recursive relationship type? Give some examples of recursive relationship types. 10 ¼c½ nks Record based MkVk ekMy ds ykHk o gkfu dks ifjyf{kr dhft,A State the major advantage and disadvantage of the two record base data models. 10 Unit II 3. fuEu dh O;k[;k dhft,% ¼v½ lqij dh ¼c½ izkFkfed dh ¼l½ fjys’ku ,ytsczk esa Økl izksMsDV ¼n½ izktsDV vkijs’kuA Describe the following: (a) Super Key (b) Primary Ke (c) Cross Product in Relational Algebra (d) Project Operation. 20 4. ,l- D;w- ,y- ls vki D;k le>rs gks \ mnkgj.k lfgr SQL dh O;k[;k dhft,A What do you mean by S.Q.L.? Describe the SQL with example. 20 Unit III 5. fuEufyf[kr dh O;k[;k dhft,% Explain the following: (a) Tuple Entity (b) Normalization (c) Codd Rule (d) Universal Relation. 20 6. ¼v½ pkSFks (4 NF) vkSj ikapos (5 NF) esa dkSu&dkSu ls phtsa dkWeu gSa \ What are common factor in fourth and fifth normal form? 10 ¼c½ fuEu Relation }kjk larq"V dh tkus okyh lHkh Functional dependencies crkb,% List all functional dependencies satisfied by the following relation: A B C a1 b1 c1 a1 b1 c2 a2 b1 c1 a2 b1 c2 Unit IV 7. B+ Vªh ij mnkgj.k lfgr ,d fucU/k fyf[k,A Write an essay on B+ tree with suitable example. 20 8. B- Vªh bUMsDl Qkby D;k gS \ mnkgj.k lfgr Mkbukfed gSl QaD’ku dh O;k[;k dhft,A What is B-tree index files? Describe Dynamic Hash Function with an example. 20 Unit V 9. ¼v½ Buffer Management D;k gS \ What is Buffer Management? ¼c½ fMLd [kjkc gksus ds mijkUr dksbZ Recovery Procedure crkb;sA Explain a recovery procedure that is needed after a disk crash. 10 10. ¼v½ MkVkcsl ds Transaction Model dh O;k[;k dhft,A Describe the Transaction Model of Database. 10 ¼c½ Failure Classification ds dqN egRoiw.kZ igywvksa dh O;k[;k dhft,A Describe some important features of failure classification. 10

Developed By SMS (The best friends group) 2 Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

Database Management Systems Database Mangement system Interelated Data rFkk ml Data dks Access djus ds fy, fy[ks x;s Programs dk lewg gSa fdlh Hkh ,d Enterprise ls Related Data ds collection dks Database dgk tkrk gSaA DBMS dk izeq[k mn~ns'; Database Information dks lgh rFkk Convenient :i ls Store djuk gSaA Database System Application: - Database dbZ txg ij iz;ksx esa yh tkrh gSaA vr% mlds fuEu Application gSaA (1) Banking ds fy, Use dh tkrh gSaA (2) Airline Reservation rFkk Information dk Schedule cukus ds fy,A (3) Universities esa Students ds Information rFkk course ds ckjs esa iwjh tkudkjh nsus ds fy,A (4) Monthly Satement dks cukus ds fy,A (5) Telecommunication ds fy,A (6) Finance esa Sales rFkk Purchase dh Information dks Store djukA (7) Sales esa Customer Product o Purchase Information dks j[kukA (8) Manufacturing esa Management ds Supply rFkk Warehouse o Order dh Information dks Store djukA (9) Human Resources ds vUrxZr Employee, salary, payroll, tax vkfn Information dks Store djukA Database System Vs File System: - File System esa Data dks Store djds Operating System ij Store fd;k tkrk gSaA System Permanent Records dks dbZ Files esa j[krs gSa rFkk fdlh File ls Record izkIr djuk rFkk u;s record dks tksM+us ds fy, vyx&vyx izdkj ds Application Program dks Use djuk iM+rk gSaA DBMS ls igys Systems blh izdkj dh files esa Data dks Store djds j[krs Fks ijUrq DBMS }kjk file system ds Disadvantages dks nwj fd;k x;k o ;gh DBMS ds Advantage gksrs gSaA (1)Data Reduandancy ds dkj.k vf/kd Storage o vf/kd Access Cost yxrh gSaSA Same Data dh Various Copies dh j[kus ls ,d le; esa lHkh dks ,d lkFk Update ugha fd;k tk ldrkA blh leL;k dks Data Inconsistency dgk tkrk gSaA (2) Difficulting in Accessing Data:- Data dks Access o Retrieve djus esa dfBukbZ u gks blds fy, fofHkUu Application Programs dks mi;ksx esa fy;k tkrk gSaA (3) Data Isolation:- Data o Processor dks ,d lkFk j[kus ls Application Programs ds }kjk vklkuh ls Data dks Access fd;k tk ldrk gSaA (4) Integrity Problem:- Data dks dqN Condition ds vk/kkj ij ,d lkFk DBMS esa j[kk tkrk gSaA (5) Atomicity Problem:- Computer System Mechanical o Electrical gksus ds dkj.k Faliure Occur gks ldrk gSaA ;fn Faliure Occur gks tk, rks MkVk dks MkVkcsl aRestore djuk vko’;d gksrk gSaA bls gh Atomicity dgk tkrk gSaA (6) Security:- gj User Database ds MkVk dks Access ugha dj ldrk gSaA flQZ MkVkcsl ds ,d ikVZ dks Access fd;k tk ldrk gSaA View of Data:- Database dk ,d y{; Users dks MkVk dk Abstract View Provide djuk gSa blesa system dh Details dks Hide fd;k tkrk gSaA ftlls MkVk dks fdl rjg Store o Maintain fd;k tk, Hkh ifjHkkf"kr fd;k tkrk gSaA Data Abstraction:- vr% MkVk dk laf{kIrhdj.k gh MkVk Abstraction dgykrk gsaA Database Users Computer Trained ugha gksrsA vr% Developers ds }kjk MkVkcal dh tfVyrk dks Users ls dj fn;k tkrk gSaA vr% laf{kIrhdj.k ds fuEu Level dks define fd;k x;k gSaA (1) Physical Level:- ;g Abstraction dk lcls Lower Level gSa tks ;g ifjHkkf"kr djrk gSa fd MkVk dks okLro esa fdl izdkj LVksj fd;k tk,A Physical Level Data Structure Detail dh tfVyrk dks ifjHkkf"kr djrk gSaA (2) Logical Level:- Abstraction dk vxyk level ;g ifjHkkf"kr djrk gSa fd Database esa D;k Data Store djuk gsa rFkk MkVk ds chp ds Relationship dks Maintain djukA (3) View Level:- ;g Abstraction dk lcls mijh ysoy gSa tks flQZ Part of the Database dks ifjHkkf"kr djrk gSaA

Developed By SMS (The best friends group) 3 Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

k tkrk gSaA View Level ij Hkh MkVkcsl ds cgqr ls Define fd. A/c Balance vkfn Attributes gSa ftls Account Entity esa define fd.k tkrk gSa mls Database Instance dgrs gSaA MkVkcsl dh iwjh Design dks MkVkcsl Schema dgk tkrk gSaA Schema dks Abstraction Levels ds vk/kkj ij ckaVk x.k gSaA Data Models:.k gSa%& (1) E-R Models (2) Relational Model (3) Object Oriented Data Model (4) Object Relational Data Model (5) Network Data Model (6) Hierarchical Data Model (1) E-R Model:.k x.os Real World Objects ftUgsa vU.k MkVkcsl esa LVksj fd.Entity Set dks iznf’kZr fd. laca/k LFkkfir djuk gh Relationship dgykrh gSaA Database ds Logical Structure dks E-R diagram ds }kjk ifjHkkf"kr fd.k tkrk gSa ftls Subschema dgrs gSaA ftlesa Database ds Different Views dks define fd.k x.Database Management Systems View level View1 View2 ViewN Logic level Instances & Schema:.k tkrk gSaA (3) Diamonds ( ):.k x.Database Structure gh Data Model gSaA Data esa laca/k] Consistency Constraint o MkVk ds dkYifud Tools dks ifjHkkf"kr djuk gh Data Models ds eq[.blesa Logical Level dh fMtkbu dks ifjHkkf"kr fd.k tk ldrk gSa] mUgsa Entity dgrs gSaA Entities dks Attributes ds Li esa Database esa ifjHkkf"kr fd.Z gSaA fuEu Data Models dks define fd.k gSa%& (1) Physical Schema:.k tkrk gSaA Customer name Customer Street Account Number Balance Cust-ID Customer City Customer Depositor Account E-R Model esa fuEu Attributes dks ifjHkkf"kr fd.9269069945 . dk.k tkrk gSaA (4) Lines (-):.k tkrk gSaA tSls A/c Number. Objects ls differentiate fd.9983850627.k gSa%& (1) Simple Value Attribute (2) Compsite Value Attribute (3) Single Value Attribute (4) Derived Attribute Developed By SMS (The best friends group) 4 Keen College Bikener (College of IT & Management) Ph.k tkrk gSaA (2) Ellipse ( ) – blesa Attributes dks iznf’kZr fd. Relationship dks lsV fd. 9785306009.Information dk og Collection ftls fdlh {k.blds }kjk Entity Set ds e/.k gSa%& (1) Rectangles ( ).Entity Set o Entity dks tksM+us ds fy.g Physical Level dh MkVkcsl design dks ifjHkkf"kr djrk gSaA (2) Logical Level Schema:.k x..s Lines dks mi.k x.ksx esa fy.k gSaA fofHkUu Entities ds e/.

d Single Value Attribute gSaA (4) Multi valued Attribute:.Database Management Systems (1) Simple Attributes:.Loan Number.ksafd .k tk ldrk gSa fd Customer us Bank ls fdruk yksu fy.bls E-R Model dk Extension Hkh dgk tkrk gSa ftleas Encapsulation ¼lHkh MkVk tks Related gks dks .d mnkgj.d vyx uke gksrk gSaA Relational Model dks Record Based Model dk . laca/k LFkkfir djuk gks Relationship dgykrh gSaA tSls Customer Table dk yksu Vscy ls lacaf/kr gksukA Same Type ds Relations dks .d Customer us cgqr ls yksu ys j[ks gSa rks og irk yxk.Composite Attributes os Attributes gSa ftUgsa Sbparts esa Devide ¼foHkDr½ fd. Hkkxksa½ esa fofHkUu ugha fd.k tk ldrk gSaA tSls%& Name .fn .k x. Amount vkfnA (2) Composite Value Attributes:.nk (0.knk Values gks rks mls Multivalue Attribute dgk tkrk gSaA tSls%& Phone Number Multi value Attribute gSa D.bl izdkj ds Attributes dks fofHkUu vU.k gSaA Relationship & Relationship Set:.k Hkh ekuk tkrk gSa D.ksafd blesa Records dks Fixed Format esa LVksj fd.d Customer .g . Attributes ls Derive fd.k gSaA Data Dictionary esa fuEu Information dks LVksj fd. ges’kk vyx&vyx gksxsaA vr% .s miyC/k 'krsZ½ cgqr ls lhLVe esa User ls laca/khr MkVk dks Hkh LVksj fd.9983850627.k tkrk gSaA (1) Name of the Relation (Relation dk uke) (2) Names of the Attributes of Each Relation (Relation ds gj Attributes dk uke) (3) Length of Attributes (Attribute dh yEckbZ) (4) Integrity Constraints ¼MsVk dks .k tkrk gSa tSls%& (1) Name of The Authorized User (2) User ls laca/khr Accounts dks lwpuk Developed By SMS (The best friends group) 5 Keen College Bikener (College of IT & Management) Ph. Middle Name o Cost Name vkfnA (3) Single Value Attribute:.k tkrk gSaA gj Vscy esa Multiple Columns rFkk gj Column dk .2. Entity Set ls i`Fkd fd.Relational Model Tables dk Collection gSa ftlesa Data rFkk Relationship dks iznf’kZr fd.d Composite Attribute gSa tSls%& First name.k tk ldrk gSaA (2) Relational Model ¼fjys’kuy ekWMy½:.k tkrk gSaA E-R Model dh .Simple Attributes dks Parts ¼vU.d ls T. Relationship dks iznf’kZr djrk gSaA fdlh Hkh Entity Set dh Primary Key ds }kjk fofHkUu Entity Set dks vU.Object Relational Data Model esa Object Oriented Data Model o Relational Data Model nksuksa dks 'kkfey fd.1.d ls T.9269069945 .k tkrk gSaA Data Dictionary:.d Property Encapsulation dgk tkrk gSaA ftlds Contents dks ckgjh rRoksa }kjk ugha ns[kk tk ldrkA (4) Object Relational Data Model:.fofHkUu Entities ds e/.d Entity dks Object dgk tkrk gSaA tc MkVk rFkk mls Access djus ds Methods dks .k tk lds½ o Object Identity (Object dh igpku) dks ifjHkkf"kr fd.d mnkgj.fn cgqr ls yksu ysrk gSa rks Loan No.k gSaA tSls .d lkFk j[kus ds fy.d lkFk .k tk ldrkA Example:.………n) Phone Numbers gks ldrs gSaA (5) Derived Attribute:.Data Dictionary esa Meta data (Data About Data) dks j[kk tkrk gSaA Table dh Design Metadata dk gh .d gh jgrh gSa tSls%& .df=r dj j[kuk gh Relationship Set dgykrk gSa tSls nks Entity Set Customer o yksu ds e/.k tkrk gSaA ckn esa mls Relational Model esa Translate dj fn..s Attributes ftudh Value ges’kk .d lkFk Single Unit esa j[kk tkrk gSa rks bls Object Oriented Model dh .d lkFk j[kuk½ Methods ¼ftlls Database ls MkVk dks Access fd. 9785306009. Borrower Relationship gSa tks Customer o yksu ds e/.d Customer ds .tc fdlh Attribute dh .k tkrk gSaA Relational Model dk abstraction level E-R Model dh vis{kk Lower gksrk gSaA Database dks igys E-R Model ds :i esa Design fd.k tkrk gSaA (3) Object Oriented Data Model:.

ksx esa fy.k tkrk gSa ftls DDl dgrs gSaA Create Table Account mnkjg.g user dks fdlh Data dh vko’.k x.9983850627.g define ugha fd.ftlesa Data Store jgrk gSaA (2) Data Dictionary:.k vU.k tk.Database ds }kjk fuEu nks Hkk"kkvksa dks iz.k gSa%& (1) Procedural DML (2) Declaration DML (1) Procedural DML dh vko’.k ds fy.s mi.k tk ldrk gSaA Developed By SMS (The best friends group) 6 Keen College Bikener (College of IT & Management) Ph.k tkrk gSa%& (1) DDL:.drk user dks blfy.h gksrk gSa rFkk Transaction dks yxkrkj fcuk O. 9785306009.k gSa%& (1) Storage Manager (2) Query Processor Components (1) Storage Manager:.k tkrk gSa%& (1) Authorization and Integrity Manager:.Data Manipulation dk vFkZ gSa%& (1) Database esa Store Information dks Access djukA (2) u.k tkrk gSa ijUrq .ksx esa fy.Database System dh Modules esa foHkkftr fd.d Special DDL esa j[kk tkrk gSa ftls Data Storage and definition Language (DSDL) dgk tkrk gSa .blesa MkVk ds Integrity Constraints rFkk Users dh Authority dh Hkh pSd fd.s mÙkjnk.s mÙkjnk.Database Management Systems (3) Password .ftlesa Data About Data dks j[kk tkrk gSaA (3) Indices:.k tkrk gSa mls Query Language dgk tkrk gSaA Database System Structure:.mls Non Procedural DML Hkh dgk tkrk gSa D.Z Hkh djrk gsaA vr% Storage Manager Data ds Relational o Updation ds fy.ksx esa fy.Database Design o mlls laca/khr fofHkUu ifjHkk"kkvksa ds laxzg dks . balance number (4) mijksDr Statement ds }kjk a/c Table dks Create fd.k tkrk gSa%& (1) Data files:.s gksrh gSa D.9269069945 .Storage Manager Program dk og Module gSa tks Low Level Data rFkk Application Programs o Queries ds e/.h gksrk gSaA Storage Manager ds }kjk fofHkUu Data Structure dks Implement fd.drk gSa o ml MkVk dks dSls Access fd.k tk ldrk gSaA ds ckjs esa crkrh gSaA (2) Declaration DML:.k x.s Information User ls Nqih jgrh gSaA Data Manipulation Language (DML):.k tkrk gSaA (2) Transaction Manger:. Interaction djrk gSaA Storage Manager File System Commands esa ifjofrZr djus dk dk.aA Database Languages:.h Information dks MkVkcsl dks LVksj djukA (3) MkVkcsl dks mifLFkr Information dks Delete djukA (4) Database esa mifLFkr Information dks Modify djukA DML dks eq[.o/kku Execute djus dk dk.s%& (a/c_number valchar(20).A Database dks Information dks Access djus ds fy.s Query dks mi..blesa MkVk dks Fast Access fd.k gSaA blds (DDl) }kjk Data dicitionary dks Hkh Update fd.k tk ldrk gSaA tc fdlh Hkh MkVk dks Read .k gSa rFkk gj Module ij System Control ls laca/khr ftEesnkjh gksrh gSaA Database System dks Functionally nks Hkkxksa esa foHkkftr fd.Data dks Main Memory esa ykus ds fy.k tkrk gSaA (4) Buffer Manager:.k tkrk gSaA DML dk og Hkkx tks lwpuk dks Relational ds fy.blds }kjk Disk Space o MkVk Structure dks iznf’kZr fd.Z Hkh djrk gSaA (3) File Manager:.k tkrk fd MkVk dks fdl izdkj Access fd.d Special Hkk"kk ds }kjk iznf’kZr fd.drk dks iznf’kZr fd.ksafd .s mÙkjnk.h gksrk gSaA Storage Manager esa fuEu rRoksa dks 'kkfey fd.g Database dh Ensistancy ds fy.r% nks Hkkxksa esa ck¡Vk x.ksafd blesa flQZ MkVk dh vko’. lwpuk.k x.k Modify djuk gks rks Database System lcls igys Data Dictionary dks pSd djrk gSaA MkVkcsl dk Storage Structure o Access Method dks .

9785306009.g DML Statements dks Low-level Instruction esa ifjofrZr djus dk dk.g DML Compiler }kjk Generated Low-Level Instruction dks Execute djus dk dk.rk ls Access fd.tks DDL Statement dks Interpreter djrk gSa rFkk mu Statement dh ijhHkk"kk dks Data Dictionary esa Store djrk gSaA (2) DMl Compiler:..9983850627.k gSa%& (1) Two Tier Architecture (2) Three Tier Architecture (1) Two Tier Architecture:.Z djrk gSaA Native /naiveUs ers Use Application Programmer Write Sophisticated Users Use Database Aministrator Use Application Interface Application Programs Query Tools Administrator Tools Compiler & Linker DML Queries DDL Interpreter Application Program Object Code Query Evaluation Engine DML Compiler & Organizer Query Processor Buffer Manager File Manager Authorization Integrity Manager Transaction Manager Storage Manager Indices Data Statistical Data Data Dictionary Disk Storage Index Application Architecture:.Database Applications dks nks Hkkxksa esa foHkDr fd.k x.Z ODBC (Open Database Connectivity) .k tkrk gSaA Developed By SMS (The best friends group) 7 Keen College Bikener (College of IT & Management) Ph.Database Management Systems (2) Query Processor:.blesa Application dks Component esa ck¡Vk tkrk gSa ftls Client Machine ij j[kk tkrk gSaA bl Component }kjk Database System dh Functionality dks Server Machine ij Query Language dh lgk.k x.k tkrk gSaA Client o Server ds e/..k JDBC (JAVA Database Connectivity) }kjk fd.9269069945 .Z djrk gSaA (3) Query Evaluation Engine:.Query Processor Components dks Include fd. Interactoin dk dk.k gSa%& (1) DDL Interpreter:.

knk Updation dh Problem Hkh ugha vkrhA (2) Access Control:.ksx Hkh fd.9983850627.d gSaA (5) Data dks Enter djus ds fy.ksx esa fy.k Disturb fd.k tkrk gS rFkk .k tkrk gSaA (6) Backup & Recovery:.ksx esa fy.d gh dkWih LVksj gksrh gSa blh dkWih dks cgqr ls Users }kjk mi.g e’khu Directly Database Calls dks ugha j[krhA Client e’khu forms ds }kjk Application Server ls Internet djrh gSaA Application Server ckn esa Database dks Database dks Access djrk gSaA cM+h Application ds fy.k tkrk gSa rFkk bUgsa Process }kjk mi.blesa Client Machine dh Front end ds :i esa iz.knk Storage Space Hkh ugha yxrk gSaA ftlls T.k tk ldrk gSaA (7) Data Sharing:.Database Administrator lqj{kk (Security) o Authorization dks mi. 9785306009.ksx ds fy.k tk ldrk gSaA ijUrq mudk Database ls Compalible gksuk vko’.k tkrk gSa .Database Management Systems USER Client Application Network Database System USER Application Network APPLICATION SERVER Server Database System 2-Tier Architecture 3-Tier Architecture (2) 3.k dbZ ckj Problem esa vk tkrk gSa] ijUrq DBMS }kjk Faliure (Hardware .DBMS Faliure ds dkj.qDr jgrk gSaA ftls www (World Wide Web) ij ju fd.Tier Architecture:.kZ LVksjst%& Objects ftUgsa Database esas Store fd.s Program Execution rFkk Transmination ds fy.k gksus ds dkj.k tkrk gSaA (8) Data Abstraction dk xq.k tk ldrk gSaA (4) Multiple User Interface:.s Three-tier dh mi.k tkrk gSa ftlls Information dh vusd Copies ugha curh o T.d txg LVksj fd.s DBMS }kjk cgqr lh lhekvksa dks ifjHkkf"kr fd.ksx esa fy.gj User Database ls vius Lo.ge tkurs gSa fd DBMS esa MkVk dh flQZ .s mÙkjnk.k Software) ls Recover gksus ds Hkh dbZ lk/ku miyC/k gSa ftlesa MkVk dks Inconsistent Data esa vkus ls cpk.s Modification fd.k MkVkcsl ds Structure dks fcuk Users dks ijs’kku .a ds izksxzke o Interface ds vk/kkj ij Interact djrk gSa bu Interface dks fofHkUu izksxzkfeax Hkk"kkvksa esa develop fd.9269069945 .DBMS ds }kjk gj Logical Data Item dks .k Data rFkk User nksuks ij iwjk Control gksrk gSaA (3) Program Object rFkk Data Structure ds fy.k tk ldrk gSaA (9) Database gj le.s miyC/k djokrk gSa vr% DBA .h gksrk gSA Database esa mifLFkr MkVk dks ckj&ckj dbZ User }kjk mi. Users dks Latest Information Provide djrk gSaA Developed By SMS (The best friends group) 8 Keen College Bikener (College of IT & Management) Ph.s iw.k tk ldrk gSaA ADVANTAGES & DISADVANTAGES OF DBMS ADVANTAGES %& (1) Redundancy Control:.

s izkjfEHkd Investment vf/kd gksrk gSa ftlesa Hardware Software o vU.k¡ ftlesa Database rFkk mu ij mi.xkA rFkk mlds dqN Features dks mi.fn mls Change u djuk gks rks DBMS dk iw.A dh .kZ mi.A dh . 9785306009.bUgsa 4 Hkkxksa esa ck¡Vk x. Trainings Hkh 'kkehy gksrh gSaA vxj Cost High gks rks nwljk rjhdk <w¡< ysuk pkfg.d Entity ls gh laca/khr gks ldrh gSaA a1 a2 a3 b1 b2 b3 b4 b5 (3) One to Many Many to One:.Database Management Systems DISADVANTAGES:(1) Database System ds fy.d Entity vf/kd ls vf/kd B dh .Enitity rFkk Relationship dks fuEu lhekvksa ds vUrxZr ifjHkkf"kr fd.d Entity b dh cgqr lh Entity ls laca/khr gks ldrh gSaA ijUrq b dh .k tk.d Entity ls laca/khr gks ldrh gSaA ijUrq B dh .d yEcs le.d Entity A dh cgqr lh Entities ls laca/khr gks ldrh gSaA a1 a2 a3 a4 a5 b1 b2 b4 (4) Many to One Many to Many:.ksx yh tkus okyh Application Simple gks rFkk ..ksx ugha fd.k gSa%& (1) One to One:.d Entity vf/kd ls vf/kd A dh .A dh vusd Entities B dh vusd Entities ls laca/khr gks ldrh gSa] mlh izdkj B dh vusd Entities A dh vusd Entities ls laca/khr gks ldrh gSaA a1 a2 a3 a4 b1 b2 b3 b4 Many to Many Developed By SMS (The best friends group) 9 Keen College Bikener (College of IT & Management) Ph.d Entity vf/kd ls vf/kd A dh .d Entity ls laca/khr gksA a1 a2 a3 b1 b2 b3 (2) ONE to ONE One to Many:.k tkrk gSa%& (1) MAPPING CARDINALITIES ¼esfiax dkMZusfyfV½ (2) Participation Constraints ¼ikfVZflis’ku dUlVªsaV½ (1) MAPPING CARDINALITY:. Recovery rFkk Integrity Constriants vkfn dks Hkh 'kkfey djuk vko’.s gh cuk.sA (2) DBMS ds lkFk vU.k tkrkA (4) dHkh&2 Database System dks Sigle User ds fy.9983850627.9269069945 .k tkrk gSaA blds fy. mifjO.s Hkh DBMS Suitable ugha gSaA MPPING CONSTRAINTS:. rd .ksa tSls Security Concurrency Control.Entity A vf/kd ls vf/kd B dh .ksx esa ugha fy.d gksrk gSaA (3) dqN ifjfLFkfr.d Entity ls Connected gks rFkk B dh .

iznf’kZr djus ds fy.iznf’kZr djus ds fy.s Customer_id Super Key gSa D.Weak Entity Set dks Double Rectangle ds }kjk iznf’kZr fd.k tk ldrk gSA tSls Customer Table ftlesa (Customer ID.ksafd Super Key esa dqN Extra Attributes dks Hkh 'kkfey fd.( ):.k tkrk gSaA (3) Diamonds:.k tkrk gSaA vr% Primary Key esa Null Value gks ldrh gSaA (4) Composite Key:.(&&):.k tkrk gSa mls Comosite Key dgrs gSaA (5) Foreign Key:.kZIr ugha gksrk gSaA D.dHkh&2 Relation .ksafd buls Hkh Customer Table dks Uniquely Identify fd. Customer Name.ku j[kuh vko’.Super Key . ( ) dks mi.k tkrk gSaA E-R Diagram ds }kjk Mapping Eardinality dks Hkh iznf’kZr fd.d Table dh Primary Key dks nwljh Table esa Hkh iznf’kZr djuk gks rks nwljh Table esa og Primary Key Attribute Foreign Key dgykrk gSaA E-R Diagram:.k tkrk gSaA E-R Model ds dqN rRo fuEu gSa%& (1) Rectangles:.k tkrk gSaA (4) Lines:. ( ) dks mi. Customer City o Customer_id dk Combination Candidate Key ugha gksrk gSaA (3) Primary Key:.tc fdlh .d Key ugha gksrh ftls Primary Key cuk.Entity o Entity Set ds chp esa Relationship dks Link ds }kjk iznf’kZr fd.k Table esa dksbZ Hkh . 9785306009.g ckr /.d ls vf/kd Attributes dk lewg gSa ftlls fdlh Entity Set dks Uniquely fd.ksx esa ysrs gSaA (3) Many to One:.ksx esa ysrs gSaA (2) One to Many:.k Customer dh City Same gks ldrh gSaA (2) Candidate Key:.ksx esa ysrs gSaA (4) Many to Many:.( ):.( ) blds }kjk Attributes dks iznf’kZr fd.k tkrk gSaA vr% Super Key dk Minimisation djuk Candidate Key dgykrh gSaA Customer_name o Customer Street nksuksa Attributes ds }kjk Customer Table ds Record dks Uniquely identify fd.ksafd blls Customer Table dks Uniquly Identify fd.iznf’kZr djus ds fy.k tk ldrk gSaA mlh izdkj (Customer_id + Customer_name.iznf’kZr djus ds fy. Customer City) vkfn gSa ds fy.ksafd Customer dk uke .d gksrh gSa fd Primary Key esa dHkh Hkh Null Value½ dks Conidor ugha fd.k tk ldsA vr% nks Attributes dks bdV~Bk dj mls Primary Key cuk.d .s i.Database Management Systems KEYS:(1) Super Key:.k tkrk gSaA ¼ijUrq . ( ) dks mi.k tkrk gSaA (5) Double Ellipses ( ):.Candidate Key esa ls fdlh .ksx esa ysrs gSaA Customer_name Customer_Street Loan Number Amount Cust-ID Customer_City Customer Borrower Loan One to One Developed By SMS (The best friends group) 10 Keen College Bikener (College of IT & Management) Ph.9983850627.k tkrk gSaA (6) Dashed Ellipses ( ):.( ) Entity Set dks blds }kjk iznf’kZr fd.k tkrk gSaA (7) Double Rectangles:.k tk ldrk gSaA ijUrq Customer name. Customer City dks Super Key ugha ekuk tk ldrk D.blds }kjk Relationship Set dks iznf’kZr fd.9269069945 .k .k tkrk gSaA (2) Ellipses:.Multi value Attributes dks iznf’kZr fd. ( ) dks mi.k tk ldrk gSaA vr% Customer_id o Customer name + Customer_Street nksuks Candidate Key gksxhA ijUrq Customer name.blds }kjk derived Attributes dks iznf’kZr fd.E-R Diagram ds }kjk MkVkcsl ds Logical Structure dks Graphically iznf’kZr fd.d Key dks as a Primary Key Choose dj fy.Super dh dk Concept User ds fy. Customer_id _ Customer_city) Hkh Super Key gSa D.k tk ldrk gSaA (1) One to One:.

dqN .d vyx Vscy esa Store fd.k tkrk gSaA Agreegation:.k tkrk gSa tSls .Database Management Systems Customer_name Customer_Street Loan Number Amount Cust-ID Customer_City Customer Borrower Loan One to Many Customer_name Customer_Street Loan Number Amount Cust-ID Customer_City Customer Borrower Loan Many to One Customer_name Customer_Street Loan Number Amount Cust-ID Customer_City Customer Borrower Loan Many to Many STRONG & WEAK ENTITY SET:.d vFkkZr~ Gross Salary gksxkA Reducing E-R diagrams into Tables:.xh rFkk mldk Output .k tkrk gSa] o mls . of Inputs ds vk/kkj ij Single Output Generate fd.k tkrk gSaA ml Entity Set dks Identity .k tk ldrk gSa ftlesa Multiple Entity Sets dks higher Level Entity Set esa muds Common Features ds vk/kkj ij ifjofrZr dj fn.fn dEiuh esa dke djus okys Employees dh Gross Salary fudkyuh gSa rks No.k tk ldrkA bl izdkj ds Entity Set dks Weak Entity Set dgrs gSaA ijUrq tc fdlh Entity Set esa Primary Key dks define fd.k tkrk gSa rks mls Strong Entity Set dgrs gSaA Weak Entity Set dks Meaning ful cukus ds fy. 9785306009.9269069945 .Database design Process dks Bottom up /kkj.k Owner Entity Set dgk tkrk gSa rFkk og Weak Entity Set Owner Entity Set ij dependent gksrk gSaA Generalization:.kk esa Hkh cuk. of Inputs eas lHkh Employees dh Dalary vk.s mls fdlh nwljh Entity ls dusDV fd.d vyx uke ls ifjHkkf"kr djrs gSaA Developed By SMS (The best friends group) 11 Keen College Bikener (College of IT & Management) Ph.sls Entity Set gksrs gSa ftuesa Primary Key dks Define gh ugha fd.9983850627.blesa fdlh Database Retrieval Process esas No.(E-R Diagram dks Vscy esa ifjofrZ djuk) E-R Database Schema dks Group of Table esa j[kk tk ldrk gSaA Database ds gj Entity Set o Relationship Set dks .

d Record dks Tuple dgrs gSaA fdlh Attributes esa mifLFkr Value dks Domain dgrs gSaA Developed By SMS (The best friends group) 12 Keen College Bikener (College of IT & Management) Ph.9269069945 .k tkrk gSaA CUSTOMER CUST_ID ADDRESS 404 M. 9785306009.Database Management Systems E-R Model rFkk Relation Model nksuks gh Relation World Entities dks iznf’kZr djrs gSaA vr% nks Model tks .9983850627.G.d ls design Principles dks Follow djrs gSa vr% E-R Design dks Relational Design esa ifjofrZr dj fn. ROAD Relation NAME RAM Domain CITY Attributes JODHPUR Tuple (1) (2) (3) (4) E-R Diagram ls ifjofrZr Vscy dks Relation dgrs gSaA Table ds Colums dks Attributes dgk tkrk gSaA .

k tk ldrk gSaA Selection Operation ds lkFk Logical Operation Perform djus ds fy.fn fdlh Record ds Particular Domain esa Value ugha Mkyh xbZ gSa rks mlesa Value dks Insert dj fn. Operations Select.k nks Relation dks fy. <.ksx esa fy.Data Base ds fdlh Relation esa fdlh Attribute esa Insert dh xbZ Value dks Domain dgk tkrk gSaA vr% fdlh Hkh Attribute esa Data dh Possible Value dks Insert djuk gh Domain Integrity dgykrk gSaA .d lkFk j[kuk ftlls MkVkcsl esa Consistency cuh jgsaA Integrity Constraints dks eq[.Select Operation ds }kjk nh xbZ Condition ds vk/kkj ij Topless dks Select fd.k tkrk gSa Slect Operation ds lkFk =.ksx esa ysrs gSaA Example:(1) Loan Relation esa ls Delhi Branch ds Records dks lysDV djukA branch-name = ‘Delhi’ (LOAN) (2) Loan Relation esa ls mu Records dks Select djuk ftudk Amount >1200 gksA Amount >1200 (LOAN) Developed By SMS (The best friends group) 13 Keen College Bikener (College of IT & Management) Ph.k tkrk gSa o Result ds :i esa . nks Relations dh vko’. Integrity Constraints dks Hkh Database ij Implement dgk tkrk gSaA tSls Database esa fdlh Hkh Record dks Insert djus ds fy. Set Difference o Cartesian Product gSaA FUNDAMENTAL OPERATION OF RELATIONAL ALGEBRA:(1) Select Project Operations dks Unary Operation dgk tkrk gSa D.d Relation ij Operation Perform djrs gSaA (2) vU.k tkrk gSaA blds fy.d Entity Set dh Entity esa .mijksDr Integrity Constraints ds vykok User dqN vU.9983850627.s 1st Letter dks Capital fy[kuk vkfnA RELATIONAL ALGEBRA (1) Relation Algebra Procedural Query Language gSaA (2) blesa Input ds :i esa .s tkrs gSa rks mlls MkVkcsl esa Inconsistency Maintain ugha gksrhA “Integrity Constraints ls eq[. <. Set difference o Cartesian Product dks Binary Operations dgk tkrk gSa D.ksx esa fy.k gSa%& (1) Domain Integrity (2) Entity Integrity (3) Referential Integrity (4) User defined Integrity (1) Domain Integrity:.ksx esa fy.lHkh Real World Objects dks Entity dgk tkrk gSa o gj Entity .ksafd os flQZ .ksafd bUgsa Perform djus ds fy.k Relation curk gSaA (3) Relational Algebra ds eq[. rkRi. #.s and(^).g Ensure fd.r% 4 Hkkxksa eas ckaVk x.d gh Data Type dh Values fd.g gSa fd Data dks dqN lhekvksa ds vUrxZr .s xzhd Letter Sigma dks mi.9269069945 .k tkrk gSa rks nwljh Vscy esa ogh Attribute Foreign Key Attribute dgykrk gSaA vr% nksuks Relation ds Key Attributes dh Value Hkh leku gksuh pkfg. rhu Operations Union. Union.s Logical Operator dks mi.d .Z .k tkrk gSaA Selection ds fy.drk gSaA (1) Select Operation:.Referential Integrity Foreign Key ij fuHkZj djrh gSaA tc fdlh Vscy dh Primary Key Attribute dks fdlh nwljh Vscy esa Hkh Consider fd. >. Project.d nwljs ls vyx gksrh gSaA tc fdlh .k tkrk gSa rks mls Entity Integrity dgk tkrk gSaA (3) Referential Integrity:. 9785306009.Integrity Constrains ds }kjk . or (v).A bl izdkj ds Constraint ¼lhek½ dks Referential Integrity dgk tkrk gSaA (4) User Defined Integrity:.d u.Database Management Systems UNIT-II Integrity Rules:. > vkfnA Operation dh Hkh mi.k tkrk gSaA (2) Entity Integrity:.k tkrk gSa fd Authorized Users ds }kjk tc MkVkcsl esa dqN cnyko fd. Not ( ¬ ) Symbol dks mi.

d Column leku gksrk gSa rks mls Relation Name o Dot (.k tk ldrk gSaA (1) nksuks Relation ftl ij Cartesian Product Perform djuk gSa esa dksbZ .g Binary Operation gSa ftlesa nks Relation ij Operations Perform fd.6).d gSaA (2) nksuks Table esa .5). (2.7).fn mu lHkh Customers ds uke dks Find Out djuk gSa ftUgksus Delhi Branch ls loan fy.8).d Relation esa 4 Records o nwljs esa 5 Records gSa rks Result ds :i esa (5x4) = 20 Records dh Display fd.d Relation dh rjg Display fd.d Column Same gksu vko’. (1.8).d gSa%& (1) nksuks Relations esa Same Number of Attributes dk gksuk vko’.k tk.ksx esa fy.xkA Relation 1 Relation 2 1 5 2 6 3 7 4 8 Relation1 × Relation2 (1.8) Example:.fn Bank ds mu lHkh Customer dh List dks Display djuk gSa ftudk Bank esa Account gks .s fuEu nks ckrksa dks /.Database Management Systems (3) Loan Relation esa ls mu Records dks Select djuk ftudk Amount >1200 o Branch delhi gksA branch-name = ‘Delhi’ ^ Amount >1200 (LOAN) (2) Project Operation :.7).k ftlesa Bank ls Loan ys j[kk gks .k tkrk gSa blds fy.d gSaA (2) nksuksa Relation esa fdlh . 9785306009. (4.Relational Algebra esa Union Operation dh (U) ds }kjk denote fd.5). (2.xkA ∏ cust _ name ( branch_name = ‘Delhi’ (borrower X loan)) SET OPERATIONS:(1) Union Operations:.ksx esa fy.s xzhd Letter ( ∏ ) dks mi.k tkrk gSaA Example:.k nksuksa rks blds fy.9983850627.fn .) Operator }kjk vyx vyx fd.d Relation Display djrk gSa ftlesa R1 Relation ds o R2 Relation ds lHkh Tuples gksrs gSa ijUrq duplicates dks Remove dj fn.s tkrs gSa bl Operation dks Perform fuEu nks Condition esa fd. amount (Loan) COMBINATION OF SELECT & PROJECT:(1) fdlh Hkh Relation dh Information dks Condition ds lkFk Display djus ds fy.ksx esa ysrs gSaA Example:(1) 10 and Relation esa ls Loan no o Amount Attributes dks Display djukA ∏ Loan No.ku esa j[kuk vko’.6).s fuEu Query dks Perform fd..k tkrk gSaA Union Operation esa nks Relation dks .s fuEu Relation Algebra Query dks fy..k gSa rks blds fy. (4.7). (2.6).5).k tk.. (1.k tkrk gSa lkFk gh Relation esa mifLFkr Duplicates dks Hkh Remove dj fn.k tk ldrk gSaA Cartesian Product dk Result Records ds Product ds :i esa vkrk gSaA tSls .xkA Cartesian Product dks fuEu izdkj Perform fd. (4.d gSaA Developed By SMS (The best friends group) 14 Keen College Bikener (College of IT & Management) Ph. (3.d Attribute dk leku gksuk vko’.k tk.k tkrk gSa . (3.5)..8). (2. (3.k tkrk gSaA tc nks Relation ij Union (U) Operation dks Perform fd.6).s Select o Project nksuks Operations dks mi. (4.xk%& ∏ customer_name (borrower) U ∏ customer_name (depositor) Union Operation Perform djus ds fy. (3.k tkrk gSa] rks Union .Cartesian Product Operation dh x }kjk denote fd.7).k tkrk gSaA tSls%& mu Customers dh Information dks Display djuk tks Delhi Brach esa jgrs gSaA ∏ Customer_name (Branch_name = ‘Delhi’(Customer)) CARTESIAN PRODUCT OPERATION:.9269069945 .fn Selected Data dh List dks Display djuk gks rks Project dks mi. (1.k tk.

k tkrk gSa Data base esa Unknown Values ds Insertion dks jksdus ds fy.k tkrk gSa blesa Hkh duplicates dks Remove fd.k tkrk gSaA SQL dk Basic Structure rhu Clauses ij fuHkZj djrk gSa%& (1) Select (2) From (3) Where • Select Operation Relational Algebra ds ( π ) Projection Operation dh rjg gSaA • From Clause Relational Algebra ds Cartesian Product ds leku gSaA (x) • Where Clause Relational Algebra ds Selected ( ) Operation dh rjg gSaA (1) Select Clause:.k tkrk gSaA (2) Interactive DML (Data Manipulation Language):.k gSa%& (1) DDL (Data Definition Language):.dkmUV Hkh gks o ftUgksaus cSad ls yksu Hkh ys j[kk gksA ∏ customer_name (borrower) ∩ Customer_name (depositor) (3) SET.k gSa rks blds fy.Relational Algebra esa Intersection Operation dks ( ∩ ) ds }kjk denote fd.Select Clause ds }kjk Records dks Display fd.View define djus ds fy.xh%& select loan_no.s fuEu Query dh tk..k tkrk gSaA (3) View Definition:.SQL DDL ds }kjk Relation Rchema dks define.s fuEu Query Perform dh tk.k tkrk gSaA blesa Hkh duplicates dks Remove dj fn.k tkrk gSa tks R1 Relation esa rks gSa ijUrq R2 Relation esa ughaA Example:.s Login Password fn.fn Loan Relation esa ls mu Records dks Select djuk gSa tks delhi branch ls gSa o ftudk Amount 3000 ls vf/kd gSa rks blds fy.k FkkA SQL dks cgqr ls Parts ls feydj cuk.k tkrk gSaA tc nks Relation ij Set difference Operation dks Apply djrs gSa rks blesa Result ds :i ea mu Records dks Display fd.blesa Tuples dks Insert.xhA ∏ customer_name (depositor) .Difference:.Transaction dh Beginning o Ending esa Hkh SQL Commands dks Include fd. delete o Modify djus ds Commands dks Insert fd.. delete o Modify djus ds Commands dks Provide djok.9983850627.k x.cSad ds lHkh Customer Name dh List dks Display djuk ftldk Bank esa Account gks ij mlus cSad ls yksu ugha fy.k tkrk gSaA Select distinct branch_name From Loan (2) Where Clause:.k tkrk gSaA Example:.s SQL DDL esa Commands dks Store fd.k x.k tkrk gSa] rks Intersection .k tkrk gSaA Example:.k tkrk gSaA (4) Transaction Control:.fn Bank ds mu Customer dks Find Out djuk gks ftudk cSad esa .(Structured Query Language):.∏ customer_name (borrower) SQL:.Where Clause esa Relation ls lacaf/kr Conditions dks fy[kk tkrk gSaA Example:.s Null Values dks Insert fd.9269069945 .SQL dks San Jose Laboratory esa IBM }kjk developed fd.s tkrs gSaA Relation Database Relations dk Collection gSa ftlesa gj Relation dks Unique name fn. from Loan where branch_name = ‘Delhi’ and amount>3000 Developed By SMS (The best friends group) 15 Keen College Bikener (College of IT & Management) Ph.d Relation Display djrk gSa ftlesa Relation R1 ds os Records tks Relation R2 esa Hkh mifLFkr gks (Common) dks Display fd.fn Relation esa ls duplicates dks Rename djuk gks rks distinct Keyword dks Select fd.Database Management Systems (2) Intersection:.Relation o View dks Access djus ds fy.fn Loan Relation ls lHkh Branch_name dks Display djokuk gSa rks fuEu Query dh tk.Relation Algebra esa Set Difference Operation dks (-) ds }kjk denote fd.k tkrk gSaA (5) Authorization:.k tkrk gSaA tc nks Relation ij Intersection ( ∩ ) Operation Perform fd..xh%& Select branch_name From loan . 9785306009.

not) dks Hkh mi.k tkrk gSa ftlesa Selection o Cartesian Product dks .drk ugha gksrhA (8) Integrity Constraints:.k gSa muls distribute Database ij Change fd.k x. >.fn Bank ds mu lHkh Customers dh List dks Display djuk gSa ftUgksaus Bank ls Loan ys j[kk gSa o lHkh Loan No.k tkrk gSa mUgsa Data Item Values ds :i eas Store fd. Amount (borrower) Loan_number = Loan.s lHkh Data Items Table esa Store jgrs gSaA (3) Logical Accessibility:.DBMS esa Data Languages ds }kjk Entity o Referential Integrity dks define fd.DBMS ds fy. Ted Codd’s ds }kjk Functional Database Management System ij Rules fufeZr fd.fn gekjs ikl nks Relation gSa%& Employee (Employee_name.fn bu ij Natural Join Operation Perform fd.RDBMS ds }kjk Data o Database Accessing Language dh ifjHkkf"kr fd.k tkrk gSaA π customer_name. <. city) Works (Employee_name.s ftu Database Languages dks cuk.xkA blds fy.d Relation esa .xkA Developed By SMS (The best friends group) 16 Keen College Bikener (College of IT & Management) Ph.k tk. Natural Join Operation Perform fd.k x.k tkrk gSaA Codd’s Rules:.k tkrk gSa . =. #) vkfn dks rFkk Logical Operator (and.E. 9785306009.fn . o Loan Amount dks Hkh Display djuk gSa rks blds fy.k tk.k dksbZ vU.s table dk uke] Column o Primary Key Value dks define fd. Street.k tkrk gSaA (4) Representation of Null Values:.xkA .k dksbZ vU.k tkrk gSaA tSls%& .s gSa tks fuEu gSa%& (1) Relation Database Management:.DBMS User ds }kjk . Loan_number.k tkrk gSaA Numeric Values ds fy.fdlh Hkh Operation ds }kjk Database esa Values dks Insert Updates o Delete fd.s tk ldrs gSaA (10) No Subversion:.lHkh Information ftls Relation Database }kj iznf’kZr fd.tc fdlh Query ij Cartesian Product Perform fd. Employee_name gSa tks nwljs esa ugha gSa rks ml Information dks Display ugha fd. Salary) vc .k gSaA (9) Data Distribution:.k tkrk gSa] lk nksuks Relation esa ls Employee name ds vk/kkj ij Selection fd. branch_name.xk ckn esa Same Loan Number okys Tuples dks Select fd.s Null Value Blank Space .s Null Value 0 . digit gksrk gSa o Character ds fy.k tkrk gSaA tSls%& .s x.k dks nwj djus ds fy.d Operation esa ifjofrZr dj fn.F.Outer Join Operation Join Operation dk Extension gSa ftlesa Missing Information dks Hkh Display fd.xh%& π customer_name.9269069945 . lcls igys Borrower o Loan Relation ij Cartesian Product Perform fd.k tkrk gSaA (2) Information Representation:. cannot (borrower Loan) Outer Join:.k tk.gj Relation ds Data Item dh Value dks Access djus ds fy. Loan_number (borrower X Loan) bl leL.k tk ldrk gSaA (7) Physical data Independence:. or.d leku flQZ .d Row ij Operation Perform fd.9983850627.k tkrk gSa rks Application Programs esa Change dh vko’.ksx esa fy.s fuEu Query Perform dh tk.k tkrk gSa ftlls Entity o Referential Integrity Constraints dh Hkh lqj{kk gksrh gSaA JOINS Natural Join:. Character Value gksrh gSaA (5) Data Language:. Loan_number.RDBMS }kjk flQZ Information dh Relational Capabilities dks Manage fd. Update & Delete:.k tkrk gSaA bls Symbol }kjk iznf’kZr fd. <.tc Physical Storage Representation .k tkrk gSaA (6) Insert.DBMS ds }kjk Null Values dks Hkh iznf’kZr fd.d vU.k tkrk gSa rks bl Product ds Result ds ckn ml ij Selection Condition dks Apply fd.k tkrk gSa rks bl Cartesian Product Perform fd.k tk.Database Management Systems Where Clause ds :i Relation Operator (>.k Access Methods dks Change fd.

s Outer Join Operation & Perform fd.k tkrk gSa o Null Value Insert dj nh tkrh gSaA Developed By SMS (The best friends group) 17 Keen College Bikener (College of IT & Management) Ph.k tkrk gSaA Outer Join Operation dks 3 Hkkxksa esa ck¡Vk x. 9785306009.9983850627.k tkrk gSa tks Right Relation dks match ugha gksrsA vr% tks Tuples Right Relation esa ugha gSa ogk¡ ij Null Values dks Insert fd.9269069945 .Database Management Systems bl Loss Of Information dks Explain djus ds fy.k tkrk gSa tks Left Relation ls Match ugha gksrsA vr% tks Tuples Left Relation esa ugha gSa ogk¡ ij Null Values dks Insert dj fn.k tkrk gSaA vr% Left Relation dh lkjh Information izkIr gksrh gSaA (2) Right Outer Join esa Right Relation ds mu lHkh Tuples dks Display fd.k tkrk gSaA vr% Right Relation dh lkjh Information izkIr gksrh gSaA (3) Full Outer Join esa Right o Left Relation ds Unmatched Operation o tuples dks 'kkfey dj Display fd.k gSa%& (1) Left Outer Join (2) Right Outer Join (3) Full Outer Join (1) Left Outer Join esa left Relation ds mu lHkh Tuples dks Display fd.s o Remove djus ds fy.

d Relation R gSa tc Database Anomalies ¼dfe.d Limitations ds fy.d Value ds fy. vkus okyh leL.k tkrk gSaA Example:. mn~ns’. 9785306009. ftl ij Attribute A depend djrk gSa mls determinant dgk tkrk gSaA (5) Functional Dependency dks nks izdkj ls mi.k gSA (4) Database esa deletion ds le. Information Loss dks u gksus nsuk gSaA Example:.k tkrk gSaA rFkk ckn esa bl Relation dks NksVs&2 Hkkxksa esa (Relation) esa foHkDr dj fn.Database Design ds le.s Hkh Functional dependency dks mi.d Value gksA (4) Attribute B.k x.k tkrk gSaA (2) Functional Dependency .s Relation cuk.k gSaA Employee = {Ecode.k R = {r1 U r2 U r3 ………. Name. U rn} . Loan Number (ii) Loan_number.k tkrkA (3) Database esa Insertion ds le..s gSaA vr% .k¡ fuEu gSa%& Bad Database design esa fuEu dfe.(i) Branch Name.k tkrk gSa rks iqu% Relation R curk gSa o fdlh Hkh Information dk loss ugha gksrk gSaA UNIVERSAL RELATION APPROACH:.d Relation Employee ftlesa fuEu Attributes dks 'kkfey fd.s Relation dks NksVs&2 Hkkxksa esa ck¡Vdj u.g dgk tk ldrk gSa fd Name Ecode ij Functionally dependent gSaA vr% Ecode dks determinant dgk tkrk gSaA vr% Ecode ds vk/kkj in Name o City nksuksa dks Access fd.k tkrk gSaA (3) fdlh Hkh Relation esa Attribute A.k Lossy decomposition dgk tkrk gSaA tSls .s Name dh Exact . City} EMPLOYEE Ecode Name City E1 A1 Delhi E2 A2 Calcutta E3 A3 Madras mijksDr Employee Table esa gj Ecode ds fy.9983850627.slh Key gSa ftlds }kjk Database ij Generalization fd.9269069945 . U rn} vr% tc lHkh decomposed Relation dks feyk.k x. Amount (iii) Loan_number.s A dh Exactiy .k tk ldrk gSa%& (1) Relation (table) dh lHkh vko’.k tkrk gSaA Decomposition dk eq[. Attribute B ij rHkh fuHkZj djrk gSa tc B dh gj Value ds fy.ksx fy. Customer Name Developed By SMS (The best friends group) 18 Keen College Bikener (College of IT & Management) Ph.ksa dks iznf’kZr fd.Database Management Systems UNIT-III Functional Dependencies %& (1) bl dependency ds }kjk Bad Database Design dks Good Database Design esa ifjofrZr fd.d .d Loan Relation esa fuEu Attributes dks ifjHkkf"kr fd.ksx esa fy.k gSa%& Loan:.s tkrs gSa ftlls fdlh Hkh izdkj dk Information Loss u gkaA bl izdkj dh fof/k.k tkrk gS%& (1) Repetetion of Information (2) Information dks dHkh&2 iwjh rjg ls iznf’kZr ugha fd.s NksVs&2 Hkkxksa esa ck¡Vk tkrk gSa rks%& R = {r1 U r2 U r3 ……….. Single Relation dks ysdj mlesa lHkh vko’.k Loss-less Join dgk tkrk gSa .ksx esa ys fy.d Functional dependency dks Check djukA (2) Relations in dqN vko’.k tk ldrk gSaA Normalization dk iwjk Concept Functional dependency ij fuHkZj djrk gSaA Relational Database Design dh dfe. vkus okyh Problem:bu lHkh leL.kvksa dks Database ls gVkus ds fy.ksa½ dks nwj djus ds fy.d Attributes dks mi.ksa dks decomposition Tecniques dgk tkrk gSa .

k x.k gSa rks bl izdkj ds Records dks danling Records o tuples dks dangling Tuples dgk tkrk gSa D.k tkrk gSa%& (1) gj Table esa .ksx esa fy.ksafd Loan Amount dks Insert ugha fd.k tkuk pfg.g Table Structure dks Simple cukus dk dk.k x.k tkuk pkfg.sA (4) Values dk Repetition ¼iqujko`fr½ Hkh de ls de gksuk pkfg. Indexing o Clustering dh tk ldrh gSa o .sA (3) Null Value dks de ls de Store fd.xk rFkk Table fuEu izdkj cusxh%& Developed By SMS (The best friends group) 19 Keen College Bikener (College of IT & Management) Ph.d gh Cell esa .wfuolZy½ vr% Null Value dks fcuk Database esa fdlh Hkh Unknown Value dks Insert ugha fd.k gSaA blds fy.k tkrkA NORMALIZATION:.d oSKkfud fof/k gSa ftlds }kjk Complex Table Structure dks Simple Table Structure esa ifjofrZr fd.k x.sA Normalization Concept dks Apply djus ds fy.k tkrk gSaA Table esa ls Redundancy dks de djus o Database Inconsistency dks gVkus ds fy.k tk.s fuEu Rules dks Follow fd.9983850627.ksx esa yh tkus okyh Normal Forms fuEu gS%& (1) First Normal Form (1NF) (2) Second Normal Form (2NF) (3) Third Normal Form (3NF) (4) Fourth Normal Form (4NF) (5) Boyce Coded Normal Form (BCNF) (6) Fifth Normal Form (5NF) (1) First Normal Form (1NF):.g Table Normalizaed Form eas ugha gSa] vr% bl ij 1NF ds Rule dks Apply fd..9269069945 .k tk. Proj Code) Employee Ecode Dept Proj Code E 101 Finance P27 P51 P20 E 303 Purchase P27 P22 E 709 Sales P51 P27 mijksDr Vscy esa lHkh Cell Value dks Insert ugha fd.d gSaA (2) gj Table esa Singal Type dh Entity dks Store fd.k gSa%& Ecode:.xk rc Record Information v/kwjh izkIr gksxh D.k tkrk gSa rFkk bl izdkj ds Relations dks Universal Relation dgk tkrk gSaA ¼. Information dk dksbZ Loss uk gksA Normalization ds cgqr ls ykHk gS] ftlds }kjk Fast Sorting.s Record Information dks [kkyh u j[kdj Null Value dks Insert dj fn.ku j[kk tkrk gSa fd Normalization ds le.d Relation Employee esa fuEu Attributes dks Insert fd.g Hkh /.(Ecode.s vyx&2 Normal Forms dks mi.d Value gksA Example:.r% mi.k gSa ijUrq Projcode Values .k tkrk gSaA blesa .d ls vf/kd gSaA vr% .s dqN Rules dks Follow dj ukeZykbts’ku fd.d Identifier dk gksuk vko’.Normalization .Database Management Systems mijksDr rhu decomposed Relation gSaA blesa ls (i) Relation esa Loan Amount dks Store ugha fd.k tkrk gSaA Vscy ges’kk fdlh u fdlh Normal Form esa gksrh gSaA eq[.Z Hkh djrk gSaA fdlh Hkh Database Design dks vPNk cukus ds fy. 9785306009.fdlh Hkh Vscy dks 1NF esa rHkh dgk tk ldrk gSa tc Vscy dh gj Cell esa .k x.ksafd tc Hkh bu rhuksa Tables dks Join djds data Access fd. Dept.

dksbZ Hkh Table 2NF esa rHkh gksxh tc og 1NF esa gks rFkk Row dk gj Attribute Primary Key in Functionally Dependent gksuk pkfg.fn dksbZ Employee Project Complete dj ysrk gSa rks Employee dk Record .knk Value gS vr% Hours. Ecode in Functonally Dependent ugha gSaA gj Project ds fy.k gSa%& (1) fdlh Hkh Employee ds department dh rc rd Store ugha fd.k tkrk gSa%& (1) mu Attributes dks Find dj mUgsa gVkuk tks Primary Key dks Part ¼Hkkx½ in dependent gksA mUgsa vyx Vscy esa Store djukA (2) vU.(Ecode.d gS vr% Dept.9269069945 .s fuEu fu.xkA mijksDr Table Non Key Attribute ¼tks Primary Key esa 'kkfey ugha gSa½ iwjh Primary Key (Key Attribute) in Functionally Depend gksus pkfg.sA (1) lcls igys Dept.d lkFk .k Table esa fuEu leL.d ls vf/kd gSa vr% Dept Pcode in Functionally dependent ugha gSaA vr% Ecode+Pcode dks 'kkfey (Whole Key) djus in Hkh Dept Functionally Dependent ugha gSa vr% dept Ecode in rks Functionally dependent gSa ijUrq Pcode in ugha vr% Part of the Primary Key ij Dept ij ughaA (2) Hours (Non-Key Attribute) dh dependency dks Check djuk gSaA Ecode ds fy. Ecode in Functionally Dependent gSaA ijUrq Proj Code ds fy.s Hkh Hours dh .xhA ftlls Inconsistency c<+sxhA (3) .s Dept dh Value .xkA Ecode ds fy.Project Table esa fuEu Attributes dks 'kkfey fd. Dept.k Project Delete djus in iwjk Record Delete gks tk. Pcode ij Hkh Functionally Dependent ugha gSaA ijUrq tc iw.s Dept. dh Value .k x.9983850627.s .k gSa%& Project:.d Vscy esa j[kukA Example:. Pcode.k x.s u fd Primary dh ds fdlh Part ijA vr% fdlh Hkh Vscy dks 2NF esa cnyus ds fy.s Hours dh .eksa dks Follow fd.Database Management Systems Employee Ecode E 101 E 101 E 101 E 303 E 303 E 709 E 709 Dept Finance Finance Finance Purchase Purchase Sales Sales Proj Code P27 P51 P20 P27 P22 P51 P27 mijksDr Table 1NF esa gSaA (2) Second Normal Form (2NF):. ckj&2 Repeat gks jgs gSa vr% Information Updation esa Hkh Problems vk.k Pcode ds fy.k tk.d ls T.d ges’kk . 9785306009. cps Attributes dks .k tk ldrk tc rd fd mls dksbZ Project u fn. Hours} PROJECT Ecode E1 E2 E3 E1 E1 E3 Pcode P27 P27 P51 P51 P20 P27 Dept Finance Pruchase Sales Finance Finance Sales Hours 90 5 7 100 50 30 mijksDr Table 2NF esa ugha gSa .kZr% Primary Key dh ckr dh tkrh gSa rks Hours (Pcode+Ecode) in Functionally dependent gSaA Developed By SMS (The best friends group) 20 Keen College Bikener (College of IT & Management) Ph.d ls vf/kd Values gSa vr% Hours. (Non-Key Attribute) dh dependency dks pSd fd.k gksA (2) Code o Dept.

k tk.. Pcode.df=r djukA Example:.s DeptHead Hkh . Dept} (2) Project = {Ecode.s fuEu Rules dks Follow fd.k tkrk gS%& (1) mu Non Key Attributes dks <w¡<dj Rename djuk tks Primary Key ds vykok .dksbZ Hkh Relation 3NF esa rHkh dgykrk gSa t cog Realtion 2NF esa gks rFkk gj Non-Key Attribute flQZ vkSj flQZ Primary Key ij dependent gksA vr% fdlh Hkh Table dks 3NF esa cnyus ds fy. Dept} (2) Department = {Dept.xkA vr% . Deptifead} (4) BOYCE-Codd Normal form (BCNF):.Database Management Systems vr% Dept .d ls vf/kd Candidate Keys gksA (2) tc Multiple Candidate Keys Composite gksA (3) tc Multiple Candidate Key esa .d nwljs in Functionally Dependent gSaA vr% bu nksuks Attributes dks vyx Table esa decompose dj fn.9269069945 .xkA (1) Dept = {Ecode.d nwljs ij Hkh depend djrk gksA (2) mu lHkh Attributes dks .dHkh&dHkh 3NF dh ifjHkk"k dqN Tables ds fy.d Relation Employee esa fuEu Attributes dks 'kkfey fd. Hours} (3) Third Normal Form (3NF):. 9785306009. Dept Head} EMPLOYEE Ecode Dept Dept Head E1 Sales E705 E2 Pruchase E302 E3 Purchase E302 E4 Sales E705 E5 Finance E301 mijksDr Relation esa lHkh izdkj dh Anomalies (Problems) mifLFkr gS%& (1) Updation (2) Deletion vr% Table dks 3NF ds fy.kksa ls ubZ Normal Form develop dh xbZ ftls BCNF dgk tkrk gSaA PROJECT Ecode E1 E2 E3 E4 E4 E1 Name A B C D D A Pcode P2 P5 P6 P2 P5 P5 Hours 48 100 15 250 75 40 Developed By SMS (The best friends group) 21 Keen College Bikener (College of IT & Management) Ph. Ecode in Functionally dependent gSaA (2) blh izdkj gj Ecode ds fy.k gSa%& Employee = {Ecode.k tk.k x.qDr ugha gksrh tSls%& (1) tc Vscy esa .xk%& (1) Employee = {Ecode.d Value gSa vr% Dept.s Dept dh .d Relation nks Parts esa divide gks tk.9983850627.s mi.d Key Attribute Common gksA bu lHkh dkj.d .s pSd djuk gksxkA bl Vscy ds fy.slk Non-Key Attribute gSa tks Relation dh Primary Key in Functionally Dependent ugha gSaA vr% ml Non Key o Key Attribute ftl ij Depend djrh gSa nksuks dks Table ls vyx dj fn. Dept.s Primary Key – Ecode gSaA (1) gj Ecode dh Value ds fy.

d ls vf/kd Values gks rks bl izdkj dh leL.k tk.g Candidate Key gSaA mijksDr Table esa fuEu lwpuk. Ecode ij Hkh Functionally Dependent gSaA (4) Ecode Hkh Name ij Functionally Dependent gSaA vr% BCNF ds fy.xk%& (1) Overlapped Condidate Key dks <w¡<dj mls Remove djuk o og ftl in dependent gSa mlds lkFk vyx Table eas decompose djukA (2) vU.k tkrk gSa%& (1) Hours Primary Key in Functionally Dependent gSaA (2) Hours. Attributes dks .s Primary Key Ecode Pcode gSa ijUrq name o Pcode dks Hkh Primary Key pquk tk ldrk gSa] vr% .lHkh Normal Form (BCNF) rd Apply djus ij Hkh Relation esa tks Main Problem jg tkrh gSa og gSa Information dk Repeat gksukA tc .k tkrk gSa mls 4NF dgk tkrk gSaA 5NF (PJNF):.k tkrk gSa rks bl izdkj dh Normal Form Project Join Normal Form .9269069945 .d lkFk .9983850627.slk Attribute gSa tks Common gSaA vr% bl Condition esa BCNF dks Apply fd.d gh Attribute ds fy.Database Management Systems bl Table ds fy.Ecode Name (2) Project:Ecode Pcode Hours (4) Fourth Normal Form (4NF):.tc Relation esa Join dependency dks Consider fd.s Multivalued dependency dks Apply fd.s fdlh nwljs Attribute dh .k4 tkrk gSaA ftl Normal Form esa Multivalue dependency dks Consider fd.k Fiften Normal Form dgykrh gSaA Developed By SMS (The best friends group) 22 Keen College Bikener (College of IT & Management) Ph.xk%& (1) Employee:.k dks nwj djus ds fy.k tkuk pkfg.d .s fuEu Rules dks Follow fd. Name + Pcode ij Hkh Functionally dependent gSaA (3) Name.¡ izkIr gksrh gSa%& (1) Table esa Multiple Candidate Key gS%& (1) Ecode + Pcode (2) Name + Pcode (1) Candidate Keys Composite gSaA (2) lHkh Condidate Keys esa Pcode . 9785306009.d Table esa j[kukA vr% Name o Ecode dks vyx Table esa j[kk tk.s ijUrq lkFk Functional deptendency dks Hkh check fd.

blesa Values dks Bucket esa Uniformly Store fd.fn Index Hkh Sorted gks rks Record dks <w¡<us esa le.s .k x.k LislA og Attribute ftlds }kjk fdlh QkbZy ds Record dks Search fd.r% nks izdkj Index dks mi.Records dh Fast Searching ds fy.k tkrk gSa ftls Hash Function dgk tkrk gSaA nksuks izdkj dh Indexing ds fy.ksx esa fy.s cgqr lh fof/k.k tk ldrk gSa tks Specific Range esa vkrk gksA (2) Access Time:.k Card Catalog dh rjg gh Database ds Indexes dks Maintain fd.k tkrk gSa rFkk lkFk mu Records dks Hkh Find fd.A (5) Space Overhead:.k gSa] rks .d Function dks mi.Ordered Index dks eq[.ksx esa fy.lHkh Files dks fdlh Search Key ds vk/kkj ij Sequentially Ordered fd.fn fdlh vU.r% fuEu Factors ds }kjk ekik tkrk gSa%& (1) Access Types:.qDr ugha gSaA gj Technique dks eq[..fdlh u.s Date Item dks Database esa Insert djus esa yxk le.Z djrh gSa mUgsa Index Sequential File dgk tkrk gSaA DELHI HYDERABAD MUMBAI A-No.fn Account Number ds vk/kkj ij Account Table ls Record Add djuk gks rks Database System] Index esa ls Disk Block <¡w<dj Record dks Main Memory esa ykrk gSaA .fdlh MkVk vkbVe dks Database ls Delete djus esa yxk le.slk vko’.k tkrk gSaA fdlh Book ds Index dh rjg gh Ordered Index esa Hkh Search Key Values dks Sorted Order esa ifjHkkf"kr fd. de yxrk gSaA eq[.k Set on item dks <w¡<us esa yxk le.ksx esa fy.r% nks Hkkxksa esa ck¡Vk x.k tkrk gSaA mnk% .fn fdlh QkbZy esa Records dks Sequentially j[kk x.blesa Records dks fdlh Attribute ls Find fd.r% Search Key Primary Key gh gksrh gSaA ijUrq .k tkrk gSa blds fy.k tkrk gSaA os Files ftlesa Search Key Primary Index ds Concept ij dk.A (4) Deletion Time:.k tkrk gSaA Bucket esa fdlh Value dks Store fd.s Index Structure dks mi. 9785306009.k tk ldrk gSaA .k tkrk gSaA bl izdkj gh QkbZy dks vyx&2 Search Key ds vk/kkj ij Index fd.k gSa rks Primary Index esa Search Key Values dks Hkh Sequentially Define fd.k¡ viukbZ xbZ gSa] ijUrq dksbZ Hkh rduhd mi.xkA Primary Index dks Clustering Index Hkh dgk tkrk gSaA Primary Index esa eq[.ksx esa fy.k tkrk gSa] Search Key dgykrh gSaA Ordered Indexes:.Database Management Systems UNIT-IV INDEXING & HASHING fdlh Book .k gS%& (1) DENSE INDEX (2) SPARSE INDEX Developed By SMS (The best friends group) 23 Keen College Bikener (College of IT & Management) Ph.fdlh MkVk vkbVe . A-217 A-101 A-110 A-215 A-102 A-201 A-218 A-222 A-305 BRANCH Amount DELHI 750 DELHI 500 DELHI 600 HYDERABAD 700 HYDERABAD 400 HYDERABAD 900 MUMBAI 700 MUMBAI 700 MUMBAI 350 SEQUENTIAL FILE DENSE AND SPARSE INDEX:.Index Structure ds }kjk vfrfjDr mi.g Database dh Sorted Values ij fuHkZj djrh gSaA (2) Hash Index:.k tk.k tkrk gSa%& (1) Ordered Index:. order dks use esa ysdj Search Key dks define fd.k x.g Index Secondary Index dgykrk gSaA (1) Primary Index:.A (3) Insertion Time:.9983850627.d ugha gSaA Sequential Order ds vykok .9269069945 .

00..s tkrs gSa rks bl izdkj ds Index dks dense Index dgk tkrk gSaA Sparse Index dh vis{kk dense Index ls Fast Searching Perform dh tk ldrh gSaA Index Record esa Search Key Value rFkk Search Key ds First Data Record ds Pointer dks j[kk tkrk gSaA BIKANER CALCUTTA DELHI MADRAS A-No.k gSaA vr% Index dks 100 blocks dh vko’. rks Indexing }kjk Records Searchdjus esa de le.s Index Hkh cgqr cM+k gks tkrk gSaA tSls .000 Records dks LVksj djuk iM+sxkA Index Records Data Records ls NksVs gksrs gSa vr% .s Primary Index ij iqu% Sparse Index cuk.k gS rks Hkh Index esa 10. 9785306009.s Index Record Maintain fd.k NksVh Value dks Search dj Sequentially Records dks Search fd.k x.Database Management Systems (1) DENSE INDEX:.s Index-Record dqN Serach Key Values dks gh Store djrk gSaA bl izdkj ds Index ls Record dks Search djus ds fy.xk ftlls Disk Block Read djus esa le.k dks nwj djus ds fy.s Index Table ls dh mlls cM+h . vf/kd yxsxkA vr% blds fy.fn Index cM+k gS rks mls Disk ij j[kk tk.ksx esa fy. A-217 A-101 A-110 A-215 A-102 A-201 A-218 A-222 A-350 BRANCH BIKANER CALCUTTA CALCUTTA MADRAS PILANI PILANI PILANI RURKI RURKI SPARSE INDEX Amount 750 500 600 700 400 900 700 100 350 MULTILEVEL INDICES:.k x.drk gksxh rFkk bu Indexes dks Disk ij Sequential File ds :i esa Store fd.k gSa o .k tkrk gSaA Sparse Index dh vis{kk Dense Index ls fast searching perform dh tkrh gSA BIKANER MADRAS RURKI A-No.s .fn QkbZy esa 10.ksx esa ysrs gSa rks Records ij Processing ds fy.fn gj Block ds fy. yxsxkA o .k tkrk gSaA ftlls File ij nks Index Create gksrs gSa%& (1) Inner Index (2) Outer Index Developed By SMS (The best friends group) 24 Keen College Bikener (College of IT & Management) Ph.k tkrk gSaA .9983850627.00 Records gSa rFkk gj Block esa 10 Records dks Store fd.fn Index dh lkbZt NksVh gks o mls Main Memory esa j[kk tk..fn Sparse Index dks mi.k tkrk gSaA vr% bl leL.g eku ysrs gSa fd .tc QkbZy dh gj Search Key Value ds fy.9269069945 .d Block esa 100 Records dks j[kk x.s Binary Search dks mi.d Index Record cuk. A-217 A-101 A-110 A-215 A-102 A-201 A-218 BRANCH BIKANER BIKANER BIKANER CALCUTTA CALCUTTA DELHI MADRAS DENSE INDEX Amount 750 500 600 200 400 250 400 (2) Sparse Index:.

Index Sequetial file Organization dh eq[.ksx esa fy.s B+ Tree Index Structure dks mi.d Block dks gh Read fd.ksx esa fy.fn Outer Index cM+k gks rks mldh iqu% Indexing dj nh tkrh gSa o lcls var esa cus Index dks Main Memory esa j[kk tkrk gSaA bl izdkj dh Indexing dks Multi-lelvel Indexing dgk tkrk gSaA Data Block 0 Data Block 1 2 (Outer Index) Main Memory (Inner Index) On Disk SECONDARY INDEX tc Multilevel Index dks mi.ksx esa fy. 9785306009.s nks levels dks Create fd.9983850627.k tk ldrk gSaA B+ Tree Index .sA ftlesa gj Search Key Value dh Index Entry dks j[kk tkrk gSa o lkFk lkFk gj Record Pointer dks Hkh j[kk tkrk gSaA Primary Index Sparse Index gks ldrk gSa ftlesa dqN Search Key Values dks gh LVksj fd.k tkrk gSa] rks bl izdkj dh Indexing dks Two-level Indexing dgrs gSaA blesa Outer Index dks Main Memory esa j[kk tkrk gSaA .k tkrk gSa o muesa ls fdlh vko’.9269069945 . gkuh .d Balanced Tree dh Form esa jgrk gSa ftlesa Root ls Leaf rd gj Path dh yEckbZ lkeku gksrh gSaA A-No. A-101 A-217 A-110 A-215 A-102 A-201 A-218 A-222 Developed By SMS (The best friends group) 25 Keen College Bikener (College of IT & Management) Ph.k tkrk gSa rks. Index level dks fuEu izdkj ifjHkkf"kr fd.k tkrk gSaA Secondary Index ds }kjk Query Performance dks lq/kkjk tkrk gSa] ftlesa Primary Index dh Search Key Values dks mi.Database Management Systems bl izdkj tc Indexing ds fy.k tkrk gSaA BRANCH Amount DELHI 500 BOMBAY 750 DELHI 600 MADRAS 700 PILANI 400 PILANI 900 RURKI 700 RAJKOT 700 SECONDARY INDEX B+ TREE INDEX FILES:.k tkrk gSa] ftlls QkbZy esa Records dk Insertion o deletion vklkuh ls fd.k tkrk gSaA (1) Inner Index (Primary Index) (2) Outer Index (Secondary Index) Secondary Index ges’kk Dense gksuk pkfg.g gSa fd tSls&2 File esa Records c<+rs gSa oSls&2 bl File Organization dk Performance level de gksrk tkrk gSaA vr% blds fy.

d de Records dks j[kk tkrk gSaA B+ Tree Index o B+ Tree File Organization nksuksa esa Insertion o deletion .ku esa j[kuk vko’..d gh izdkj ls fd.fn n dh Value nh xbZ gS rks mlesa N-1 Value o N Pointers dks j[kk tk.. rks fuEu ckrksa dks /.d ckj gh iznf’kZr fd. vU..ksx esa fy. mifjO.Database Management Systems B+ Tree Structure Insertion o deletion mifjO. 9785306009.ksa ls vf/kd mi.9983850627.g mifjO.k tkrk gSaA leaf node fcYdqy B+Trees dh rjg gksrh gSaA Developed By SMS (The best friends group) 26 Keen College Bikener (College of IT & Management) Ph.k tkrk gSaA .k tk.d gSa%& (1) .d Node esa N-1 Values rFkk N= 3 Pointers dks Store fd.qDr gSaA D. dks rks Remove dj nsrk gSa ijUrq Space Overhead dks Add dj nsrk gSa ijUrq .k tkrk gSaA B Tree ds }kjk Search Key Values dks . vUrj .ksafd blls File Organization dk Performance Level c<+ tkrk gSaA B+ Tree Structure dks Index ds lkFk lkFk File Record ds Organizer ds :i esa mi.k tkrk gSaA blesa B+ tree ds leaf Nodes esa Pointers ds LFkku ij Record dks Store fd.B-Tree Index fcYdqy B+ Tree Index dh rjg gh gksrh gSaA nksuksa Index Files esa eq[.fn fdlh B+ Tree dks ifjHkkf"kr fd.9269069945 .g gSa fd B-Tree Index esa Search Key Values dh Redundaut (Duplicate) Values dks Remove ¼nwj½ dj fn.xk tSls%& .xkA Val1 Val 2 3rd Pointer 1 Pointer 2nd Pointer Leaf Node Bombay y Delhi z A-212 Bombay A-101 Delhi A-110 Delhi B-Tree Index Files:.k tkrk gSaA I C F K M A.k tk.8 C1 D5 E4 F7 G3 H3 I4 IB K1 L6 M4 H8 P6 B+ Tree File Organization B+ Tree esa leaf node esa nonleaf Node ds Point ls] .4 B.fn N=3 gks o Search Key Branch Name gSa rks .

drk ugha gksrhA Hashing ds }kjk Hkh Index dks cuk.s Index Structure dks Access fd.k) fuEu izdkj fd.fn Overflow Bucket Hkh Full gks tk.d leku Records dks Store fd.A Overflow dks jksdus ds fy.d Space ugha gS] rks Bucket Overflow dh ifjfLFkfr mRiUu gksrh gSaA Bucket Overflow cgqr ls dkj.k gSaA vr% Search Key Values dks Bucket esa j[kus ds fy.lcls csdkj Hash Function og gSa ftlesa .k tkrk gSa o blds fy.k tkrk gSaA .knk Records dks Store dj fn.k vr% nB tc nr/fr ls vf/kd gksxk rHkh Bucket Overflow dh leL.d Disk Block ds vko’.k tkrk gSa%& (1) forj.s .k tkrk gSaA tks Record ds Bucket Address dks Return djrk gSaA bl izdkj Records dks mijksDr fof/k }kjk Delete Hkh fd.d Function gSa ftlds }kjk K Search Key Values ls B Bucket ds Specific Record ij igq¡pk tkrk gSaA fdlh Record dks mldh Search Key (k1) ds lkFk Store djus ds fy.k tk.r% nks dkj. rks System }kjk vU.k tk. Buckets dks Allocate dj fn.ksx esa fy.k tk ldrk gSaA (2) Skew ¼Ld.k .k tk ldrk gSaA tSls%& .d . ml ij h (Hash Function) (ki) ijQkeZ fd.k tkrk gSaA ftlls vko’.d Record dks vklkuh ls Search dj fy.d Bucket esa fit gksus okys Records dh la[.gk¡ nr.fn Bucket esa vko’.k Uniform gksuk pkfg.k fd.s Space Hkh dh tkrh gSaA ijUrq .s Hash Function dks mi.ksx esa fy.9269069945 .lHkh Records ftUgsa Store djuk gksA fr.9983850627.k tkrk gSaA ftlesa .d Disk Block ls NksVk .s iwjh Bucket Record dks Search djuk iM+rk gksA .k tk ldrk gSaA Hash Function:.k tk. ¼leku½ (2) forj.Database Management Systems Static Hashing:.fn Record dks Bucket b esa Store djuk gSa o b igys ls iwjh gks pqdh gSa rks System }kjk b dks Oveflow Bucket ns nh tkrh gSa rFkk Record dks Overflow Bucket esa Insert dj fn.k tkrk gSaA bl izdkj dh List dks Overflow Chaining dgk tkrk gSaA Developed By SMS (The best friends group) 27 Keen College Bikener (College of IT & Management) Ph.tc Record dks Insert fd.k tk.k tkrk gSa tcfd nwljh Buckets esa Space cpk gksrk gSaA bl izdkj dh Condition dks Skew dgk tkrk gSaA Skew eq[.kksa ls mRiUu gksrh gSa%& ¼1½ tc cgqr ls Records dh .¼tc iw. 9785306009.g Øe pyrk jgrk gSaA lHkh Overflow Buckets dks ml Bucket ds lkFk Link list dh rjg Store dj fn.g gSa fd MkVk dks Search djus ds fy. Hashing rduhd in fuHkZj djrh gSa rks blls vf/kd I/O Operation dh vko’.kksa ls mRiUu gksrk gSa tks fuEu gSa%& (1) Insufficient Buckets:.k tkrk gSa rFkk B }kjk lHkh Bucket Address dks iznf’kZr djrk gSaA Hash Function h .k cM+k gks ldrk gSaA ekuk K ds }kjk lHkh Search Key Values dks iznf’kZr fd. Bucket dh vis{kk T.bl Organization esa Record dh Search Key Value ij .g vko’.k x.d Disk block tSlk gSaA ysfdu .k Random ¼vleku½ Hkh gks ldrk gSaA Bucket Overflow:.d :i esa Store fd. Overflow Bucket Provide djok nh tkrh gSaA bl izdkj .d deh .A vFkkZr~ lHkh Buckets esa .k tkrk gSaA Hashing ds vUrxZr Bucket Keyword dks mi.ksx fd.k tkrk gSaA Buckets esa Search key Values dk distribution (forj.g .Sequential File Organization dh .kZ :i ls Buckets miyC/k uk gks½%& Buckets (nB) ges’kk nr/fr ls vf/kd gksuh pkfg.k dks gVk.s Binary Search dks mi.k tkrk gSaA Hash File Organization:.d vPNk Hash Function ogh gSa ftlesa Key Values dks lHkh Bucket .d gSa fd vU.A vr% gj Bucket esa Records dh ek=k leku gksrh gSaA vr% Design time ij User ugha tkurk fd fdl Search Key Values dks File esa dgk¡ LVksj fd.k tkrk gSa rks Bucket esa ml Record ds fy.d ls vf/kd Records dks Store dj j[kk tkrk gSaA vr% Bucket . Bucket Overflow dks Overflow Bucket }kjk Hkh nwj fd..d Search dh gksA ¼2½ tc Hash Function }kjk Search Keys dk vleku forj.d gh Bucket esa lHkh Search Key Value dks j[kk tkrk gSaA ftlls fdlh Hkh Record dks <¡<us ds fy.sA .d Function ¼QaD’ku½ Perform fd.k tkrk gSaA ftlls vf/kd Input/Output Operations dks Perform djuk iM+rk gSaA ijUrq tc File Organization.w½%& dqN Buckets esa vU.

s vko’.Index Database dh Efficient Processing ds fy.d gksrs gSa ftlesa Transaction dks Update fd.s vko’.Hasing dks File Organization ds lkFk&lkFk Index-Structure ds fy.k tkrk gSaA Dynamic Hashing:.k tk ldrk gSaA INDEX DEFINITION IN SQL:.ksx esa fy. 9785306009.d Hkh gSaA Dynamic Hashing fof/k.k tkrk gSa%& (1) Current File Size ds vk?kkj ij Hash Function dks pquuk (2) ml Hash Function dks pquuk tks Current File ds lkFk lkFk vfrfjDr Space dks Hkh Consider djs ftlls Performance Hkh c<rh gSa ijUrq Space vf/kd Waste gksrk gSaA (3) File Growth ¼c<us½ ds lkFk lkFk Hash Structure dks Hkh iqu% Reorganize djuk .Create index <index_name> on <relation_name> (<attributes>) Attributes esa mu Columns dks 'kkfey fd.k tk ldrk gSaA vFkkZr~ Hash Function Database dh Growth dks rks ugha cny ldrk ijUrq Growth ds lkFk lkFk Hash Function dks ifjofrZr fd.k tk ldrk gSaA hash index ds }kjk Search Key dks mlds Pointer ds lkFk Hash File Structure esa Store fd.tc Bucket b esa Fix Address dks j[kk tkrk gSaA Static Hashing ds le.ksa ds }kjk Hash Function dks Database ds c<us .9269069945 .k tkrk gSaA o mu ij Queries Hkh Perform dh tkrh gSaA SQL esa Index Create djus ds fy.s fuEu Option dks mi.k tkrk gSa ftu ij Index Create djuk gksA Developed By SMS (The best friends group) 28 Keen College Bikener (College of IT & Management) Ph.9983850627.k de gksus ds lkFk&2 ifjofrZr fd.s Create Index Command dks mi.g Operation time Consuming rks gSaA ijUrq Accessing ds fy.k tkrk gSaA Syntax:.ksx esa fy.Database Management Systems Bucket 0 Bucket 1 Bucket 2 Overflow Buckets for Bucket 1 HASH INDICES:.s Hkh mi.ksx esa fy. dHkh dHkh Serious Problems Occur gks tkrh gSaA vr% bl izdkj dh Condition Occur uk gks blds fy.

System Crash dk Non-Volatile Storage ij vf/kd izHkko iM+rk gSaA Non-Volatile Storage.9983850627.k Disk Block ds [kks tkus ls Data Transfer Operation ds lkFk tks Faliure mRiUu gksrk gSa mls Disk Faliure dgk tkrk gSaA vr% MkVkcsl esa Consistency cuk.sA mijksDr lHkh Properties dks ACID Properties dgk tkrk gSaA Developed By SMS (The best friends group) 29 Keen College Bikener (College of IT & Management) Ph.Database Management Systems UNIT-V FALIURE CLASSIFICATION:.tc Database esa Multiple Transaction Execute gks jgh gks rks igyh Transaction ds [kRe gksus ij gh nwljh Transaction dks Execute gksuk pkfg.Head ds Crash gksus . mnkgj.(System esa gksus okys Faliure ds Hkkx):.k¡½ viukbZ xbZ gSa] ftUgsa Recovery Alogrithm dgk tkrk gSaA .9269069945 .k tkuk vko’.k Operating System esa Error vk tk. 9785306009.k gSaA Volatile Storage ls MkVk dks Fastly Access fd.s] ftlls Database esa Consistency cuh jgrh gSaA (3) Isolation:.s eq[.sA (4) Durability:.r% Storgae nks izdkj ds gksrs gSa%& (1) Volatile Storage (2) Non-Volatile Storage (1) Volatile Storage:.k eq[.r% nks izdkj ds gksrs gS%& (1) Normal Transaction Processing ds fy.fdlh Hkh Transaction ds Fail gksus dk dkj. rks .g Logical Error dgykrh gSaA tSls%& Data dk uk feyuk .k Cache Memory bl Storge ds eq[.d Transaction iwjh Execute gks tk.ksafd Disk . j[krs gSaA STORAGE STRUCTURE Storage Media dks mldh Speed {kerk ds vk/kkj in ifjHkkf"kr fd.k tk ldrk gSaA User }kjk Execute dh tkus okyh lHkh Transactions .d . rd fdlh Internal ¼vkarfjd½ Condition ds dkj. ftlls Volatile Storage dh Information lqjf{kr uk jgs rks blls Hkh Transaction :d tkrh gSaA (3) Disk Faliure:. o blls Transaction Normal Execution esa u jgs rks bl izdkj dh Error dks System Error dgk tkrk gSaA (2) System Crash:. rHkh mlls lacaf/kr Updates dks Database esa fd.k Normal u jg ik.d Transaction Execute gks jgk gks rks nwljk Transaction Execute ugha gksuk pkfg.System esa dbZ izdkj ds Faliures gksrs gSaA ijUrq lcls Simple Faliure og gSa ftlls fdlh Hkh izdkj dk Information dk Loss uk gksA ijUrq ftuesa Information Loss gksrk gSaA mlls cgqr eqf’dy ls Recovery dh tkrh gSaA eq[. nks Errors gks ldrh gSa%& (1) Logical Error:.tc Hardware.qDr Iformation dk gksuk rkfd Recovery vklkuh ls gks ldsA (2) Faliure dks Recover djrs le.k Statements dks Begin Transactoin o End Transaction ds chp j[kk tkrk gSaA vr% Database System esa fdlh Hkh Transaction dh Properties dks Follow fd.k Tape (Non-Volatile Storage) Electro Mechanical ¼bysDVªkseSdsfudy½ gSa tcfd Volatile Storage Chips ds cus gksrs gSaA Stable Storage:.tc System fdlh vupkgh fLFkfr tSls dead lock dh fLFkfr esa vk tk.wfuV gSa ftlds }kjk fofHkUu Data Items dks Access o Update fd.Stable Storage esa j[kh xbZ Information dk Loss ugha gksrk gSaA TRANSACTION MODEL Transaction izksxzke Execution dh . Data dk Oveflow gksuk vkfnA (2) System Error:.System Crash ds nkSjku Volatile Storage esa j[kh xbZ Information ugha gVrh gSaA Main Memory .s mi.k tkrk gSaA (2) Non-Volatile Storage:.VkWfeflVh½:. Database Software .r% mRiUu gksus okys Faliures fuEu gSa%& (1) Transaction Faliure:. j[kus o Failure ls Recovery ds dqN Techniques ¼fof/k.k tkuk pkfg. Database esa lkQ&2 iznf’kZr gksus vko’.d gSaA (2) Consistency:. Volatile Storage dh vis{kk Slow gksrs gSa D.tc Database esa dksbZ . Database dks Consistent o Atomic cuk.k tkrk gSaA vr% eq[.tc .d gSa%& (1) Atomicity ¼.Transaction esa gksus okys lHkh Operations.tc Transaction dk Execution vf/kd le.

s Log Stable Storage esa Store fd.r% Log record esa fuEu Fields dks ifjHkkf"kr fd.Transaction Ti ds Abort gksus ijA . V1.g irk yx tk.k x. xj.9269069945 .Transaction ds Commit gksus ijA (4) <Ti Abort> .k tkrk gSaA Read – Database Data Item Local Buffer Write (x) Operation }kjk Data Item x dks Local Buffer ls iqu% Database eas Send fd.s tk ldrs gSa%& Log Records esa lHkh Database Transaction dk iw.tc .Database Management Systems fuEu nks Operations ds }kjk dksbZ Hkh Transaction Data dks Access dj ldrk gSa%& (1) Read (x) (2) Write (x) Read (x) Operation ds }kjk Data item x dks Database ls Local Buffer esa Send fd. fd vc Transaction dk Normal Execution laHko ughaA (4) Aborted:.s x. Data Recovery esa lgk. 9785306009.Ti – Transaction Transaction dk Execution izkjEHk gksus ij Log Record esa Entry.Faliure u gksus ij lHkh Transaction lQyrkiwoZd iw.kZ rjhdk Log gSaA Log esa Log Records j[ks tkrs gSaA eq[.rk iznku djrs gSaA .d State esa gksuk pkfg.tc Transaction dk Last Statement Execute gksA (3) Failed:. tc Transaction Execute gks jgh gksA (2) Partially Committed:.k Disk Faliure ds le.s fuEu nks izdkj ls Log Records Maintain fd..tc Transaction dk Execution lQyrkiwoZd gks tk. V2 – vr% Transaction }kjk Xj data Item ij Operation Perform djukA V1 – xj data item dh Old Value V2 – Xj Data Item dh New Value (3) <Ti Commit> .Data Item dh iqjkuh Value Write djus ls igys okyhA (4) New Value:.g Transaction dk .k tkrk gSaA (1) Ti <Start> . j[kus ds fy.k tkrk gSaA write – Database Data Item Local Buffer TRANSACTION STATE:.tc lQyrkiwoZd Execution uk gksA (5) Committed:.¼VªkWtsD’ku vkbMsfUVQk.izkjfEHkd State.Data Item dh u.9983850627.kZ gks tkrs gSaA tc Trasaction lQyrkiwoZd Complete ugha gksrh rks bl izdkj dh Transaction dks Aborted Transaction dgk tkrk gSaA Aborted Transaction }kjk fd.s Log Records System .kZ Record j[kk tkrk gSaA Developed By SMS (The best friends group) 30 Keen College Bikener (College of IT & Management) Ph.s%& (1) Active:.k tkrk gSaA (2) Data Item:.j½ .h Value (Write djus ds ckn dh Value) Log Record dh Values dks fuEu izdkj ls iznf’kZr fd.d Identifier gSa ftlds }kjk Write Operation Perform fd. (2) <Ti.g Data Item dh Disk ij fLFkfr dks iznf’kZr djrk gSaA (3) Old Value:.k gSa%& (1) Transaction Identifier:.kZ lQyrkiwoZd dj ysrh gSa] rks mls Transaction dk Commit gksuk dgrs gSaA vr% dksbZ Hkh Transaction fuEu esa fdlh Hkh .A LOG BASED RECOVERY:.Database esa gksus okys ifjorZuksa dks Store djus dk lcls egRoiw.s Changes dks tc Reject dj Transaction dks iwoZ fLFkfr esa ykuk Transaction Rollback dgykrk gSaA tc Transaction viuk Execution iw.s tkrs gSaA Transaction dh Atomicity dks cuk.

A vr% bu lHkh Log Records dks .s Recovery Procedure ¼fjdojh izkslhtj½ pykrk gSaA ftlls Database dks iqu% Consistent State esa yk.k Write fd..k tkrk gSa rFkk ckn esa Transaction dks Undo o Redo fd.d gSa fd .s System Database ds gj Block ds fy.xh tc <Ti Commit> Log Record dks Stable Storage esa fy[k fn.d gh LFkku ij j[kk tkrk gSaA tc Database ij Operation fd.k x.k gSa os Hkh Log Records esa 'kkfey gksrh gSa ftlls Recovery esa le.k tk.s tkrs gSa tc Log Record Partially Commit uk gks tk.d Log Record dks Stable Storage esa u j[kdj .d lkFk lHkh Log Records dks Block Size ds vk/kkj ij Buffer esa .k tkrk gSaA ijUrq Log Records ls Information Access djrs le.kZ gks tkrk gSa] rc blh Information dh Copy Second Block esa dj nh tkrh gSaA (3) bl izdkj Second Block ij Information Copy djus ds ckn gh Operation Complete gksrk gSaA (1) Log Record Buffering:.k tkrk gSaA ijUrq cgqr ls mifjO.s Log dks pSd fd.Database Management Systems (1) Deferred Database Modification:.ge tkurs gSa fd gj Log Record tc Create gksrk gSa] rks mls Stable Storage esa LVksj dj fn.s tkrs gSaA .k tkrk gSaA bu Log Records dks Stable Storage esa mlh Øe esa LVksj fd.9983850627. vf/kd yxrk gSaA (2) dqN . ds fy.slh Transaction ftUgsa Update dj fn.k gSa o System Crash gks tkrk gks bl fLFkfr ds fuEu Recovery Procedure ¼izkslhtj½ dks viuk.df=r dj fy.9269069945 .k tkrk gSaA blds fy. nks eq[.d&.k tkrk gS%& (i) dksbZ Hkh Transaction ¼Vªk¡tsD’ku½ ti rHkh Commit State esa tk.blesa Transaction ds Active State ds lkFk&lkFk gh Database esa Updation dj fn.sA Developed By SMS (The best friends group) 31 Keen College Bikener (College of IT & Management) Ph. 9785306009. vf/kd yxrk gSaA bl izdkj ds mifjO.bl rduhd esa Database Updation rHkh fd.A (ii) <Ti Commit> Log Records dks Stable Storage esa j[kus ls igys ti ls lacaf/kr lHkh Log Records dks Stable Storage esa fy[k fn.d lkFk bdV~Bk dj fQj mls Stable Storage eas Store fd.s Main Memory esa Buffer Allocate dj nh tkrh gSaA bl Buffer dks Log Buffer dgk tkrk gSaA vr% .s Records Log Buffer esa gksrs gSaA Log Buffering ds dkj.k x.s Check Points ds Concept dks rS.k tkrk gSa%& (1) lcls igys Information dks igys Block esa Store .s j[kk tkrk gSa rFkk ckn esa mUgsa Stable Storage esa Store djrs gSaA ijUrq .d lkFk bdV~Bk djus ds fy.k tk.tc System Failure gksrk gSa rc Recovery ds fy.kA (1) lHkh Log Records dks Stable Storage ls Main Memory esa ykuk (2) lHkh Updated Buffer Block dks .s nks Physical Block rS.kj djrk gSa] ftUgsa .ksa dks gVkus ds fy.k tkrk gSaA (2) tc First Write Operation lQyrkiwoZd iw.kj fd..fn Main Memory esa Log Records dks j[kk x.k tkuk pkfg.fn System esa Data Transfer Faliure Occur gqvk gS] rks System blds fy.d rjQ djukA (3) Stable Storage esa mijksDr Log Record ij Check Point ¼psdikWbUV½ yxkukA BUFFER MANAGEMENT (1) Log-Record Buffering (2) Database Buffering .k tkrk gSa rFkk ckn esa mls Stable Storage ds Block esa LVksj dj fn. Hkh bl Storage esa 'kkfey gksrs gSa tSls%& Stable Storage dks Blocks esa ck¡Vk tkrk gSa o eq[.s vko’. Problems vkrh gsa tks fuEu gS%& (1) Records dks <w¡<us esa le.r% Log Records ds Size mu Blocks ls cgqr de gksrh gSa ftlls Memory Block dk dqN Hkkx [kkyh gh jg tkrk gSaA vr% blds fy.d Block Size ds Log Records dks .h Value Set djukA Check Points:.k tkrk gSa] rks fuEu Steps dks Follow fd.h Value dks iqjkuh ls Replace (2) Redo (Ti) – Data Item dh u.k Log Records dks flQZ Main Memory esa dqN le.k tkrk gSa ftl Øe esa .s Recovery Scheme nks izdkj ds Recovery Procedure ¼izkslhtj½ dks Follow djrh gSa%& (1) Undo (Ti) – u.A (2) Immediate Modification:.

s mi.k tkrk gS%& (1) .fn Database ds fdlh ist ij Operation djuk gks rks ml ist rd Page Table ds }kjk igq¡pk tkrk gSaA (5) Page Table esa N Entries gksrh gSaA gj Entry Database ds .k tkrk gSa] tc b2 dk dk.Database Management Systems (iii) Data Operations .k tkrk gSaA D.s ist ds Pointer dks Allocate dj fn.ksafd Database dh vis{kk Main Memory cgqr NksVh gksrh gSaA vr% .9983850627.A vr% Block b1 ij .xkA ftl in ith Page dh dkWih dh xbZ FkhA vc X dh ubZ Value xj dks buffer esa j[k fn.k tkrk gSaA (2) .k Log Records dks Database esa Write djus ls igys lHkh Log Records dk Stable Storage esa gksuk vko’.Z iw.k tk.k tk.xkA ¼eq[.s u.k tk.ksx esa fy.g gSa fd blesa nks Page Tables dks Maintain fd.k tk jgk gSa rks System Current Page Table dks fuEu izdkj ls Change djrk gSa%& (i) lcls Disk ls .g vko’. fof/k gSa ftls Shadow Paging dgk tkr gSaA (2) bl Technique esa Database dks Fixed length bbcks esa ck¡Vk tkrk gSa ftUgsa Pages dgrs gSaA (Pages Operating System dk Concept gSa ftls Memory Management ds fy.k tkrk gSaA ekuk fd Transaction Ti Write (x) Item Operation Perform djuk pkgrk gSa rFkk X Data Item fdlh ith Page ij iM+k gSaA System }kjk Write (x) Operation fuEu izdkj Perform fd.k tkrk gSa rFkk ckn esa Block B2 dks main Memory esa yksM fd.k tkrk gSaA (3) ekuk fd Database dks 1 ton Pages esa ck¡Vk x.s Page disk ij fdlh Order ¼Øe½ esa ugha gSaA (4) .e dks (WAL) Write Ahead Logging dgk tkrk gSaA Buffered Log dks Disk ij Write djuk Log Force dgykrk gSaA Database Buffering:.k tkrk gSaA SHADOW PAGING (1) Recovery dh .d Unused Page dks fy. Idea .k tkrk gSaA Developed By SMS (The best friends group) 32 Keen College Bikener (College of IT & Management) Ph.k tkrk gSaA blds fy.s Current Page Table dks mi.k tk.d gSa fd fdlh nwljs Block dks Memory esa ykus ls igys] igys Block dks iqu% Disk ij Write dj fn.System Database dks Nonvolatile Storage esa Store djrk gSa rFkk tc MkVkcsl esa Operation djus gks rks fdlh Specific Data Block dh dkWih dks Main Memory esa yk.d vU.kZ gks tkrk gSa rks mlds Output dks Stable Storage esa j[k b1 dks Execute fd.k tkrk gS%& (1) Current Page Table (2) Shadow Page Table (9) tc dksbZ Transaction Perform dh tkrh gSa nksuks Page Tables esa Same Entries gksrh gSaA Shadow Page Table Transaction ds nkSjku dHkh Change ugha gksrhA (10) ijUrq Current Page Table Transaction ds Write Operation ds nkSjku Change gksrh jgrh gSaA (11) lHkh Input rFkk Output Operation ds fy.d gSaA bl fu.ksx esa fy.k gSa ijUrq .ksx esa fy.s tkrs gSa%& (1) b1 ls laca/khr lHkh Log Records dks Stable Storage esa Store djukA (2) Block b1 dks Disk ij fy[kukA (3) Block B2 dks Main Memory eas ykukA ijUrq .fn Operation Perform gks pqdk gSa rks igys b1 Block dks ckgj dj Block b2 dks Main Memory esa yk.r% Database ds ikl free Pages dh List gksrh gSa½ (ii) bl Free Page dh Entry dks Database dh Free Page List esa ls gVkuk o ith Page ds Data dks u.k tkrk gSa o var esa Blocks dks Disk ij fy[k fn.d Page dks iznf’kZr djrh gSaA (6) gj Entry ds lkFk Pointer Hkh gksrk gS] tks Disk ij Page dks Point djrk gSaA (7) igyh Entry Database ds igys ist dks iznf’kZr djrh gSa o Second Entry nwljs ist dks iznf’kZr djrh gSaA (8) Shadow Paging rduhd dk eq[.fn Block b1 ds }kjk Block b2 dks Call fd.s fuEu Steps esa Operation Perform fd.xkA blds fy.fn ith Page ¼ftlesa X data Item Stored gSa½ Main Memory esa ugha gS] rks System }kjk lcls igys Input (x) Operation Perform fd.s Virtual Memory Concept dks mi.s ist ij dkWih djukA (iii) vc Current Page Table esa ml ith Page dh Entry ds fy.fn Transaction }kjk bl ith Page ij igyk Write Operation Perform fd.k tkrk gSa rks Hkh B1 ds lHkh Output dks Buffer Use esa ysdj Stable Storage esa j[k fn.9269069945 . 9785306009.

fn Crash ds nkSjku Current Page Table Lost (destroy) gks tkrh gSa rks System }kjk Shadow Page Table ls Recovery dj yh tkrh gSaA vkSj mlh Shadow Page Table dh Copy iqu% Main Memory esa dj Current Page Table cuk nh tkrh gSaA 1 2 3 4 5 6 7 1 2 3 4 5 6 7 Shadow Page Table (Disk) Page disk Current Page Table (Main Memory) Developed By SMS (The best friends group) 33 Keen College Bikener (College of IT & Management) Ph. 9785306009. . .k tkrk gSaA vr% Current Page Table }kjk u. . .h shadow Page Table cuk nh tkrh gSA bl izdkj Current Page Table Main Memory esa LVksj jgrh gSa o Shadow Page Table Disk ijA . Simle Page Table Pages on disk Shadow Page Table dks Disk ij Store fd.Database Management Systems 1 2 3 4 .9269069945 .k tkrk gSaAftlls transaction execution state dks Recovery dh tkrh gS A tc transaction Commit gks tkrh gSa rks System }kjk mls Current Page Table ls Disk ij Store dj fn. . . n Page Table .9983850627.

Sign up to vote on this title
UsefulNot useful