Vous êtes sur la page 1sur 33

Database Management Systems

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

Developed By SMS (The best friends group)


1
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

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 nkkZb,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 fjysku ,ytsczk esa kl izksMsDV
n izktsDV vkijskuA
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+ Vh ij mnkgj.k lfgr ,d fucU/k fyf[k,A
Write an essay on B+ tree with suitable example.
20
8. B- Vh bUMsDl Qkby D;k gS \ mnkgj.k lfgr Mkbukfed gSl QaDku 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

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

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

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems

View level
View1

View2

ViewN

Logic level

Instances & Schema:- Information dk og Collection ftls fdlh {k.k MkVkcsl esa LVksj 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 gSa%&
(1) Physical Schema:- ;g Physical Level dh MkVkcsl design dks ifjHkkf"kr djrk gSaA
(2) Logical Level Schema:- blesa Logical Level dh fMtkbu dks ifjHkkf"kr fd;k tkrk gSaA
View Level ij Hkh MkVkcsl ds cgqr ls Define fd;k tkrk gSa ftls Subschema dgrs gSaA ftlesa Database ds
Different Views dks define fd;k x;k gSaA
Data Models:- 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[; dk;Z gSaA fuEu Data Models dks define fd;k x;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:- os Real World Objects ftUgsa vU; Objects ls differentiate fd;k tk ldrk gSa] mUgsa Entity dgrs
gSaA Entities dks Attributes ds Li esa Database esa ifjHkkf"kr fd;k tkrk gSaA tSls A/c Number, A/c Balance vkfn
Attributes gSa ftls Account Entity esa define fd;k x;k gSaA
fofHkUu Entities ds e/; laca/k LFkkfir djuk gh Relationship dgykrh gSaA Database ds Logical Structure dks E-R
diagram ds }kjk ifjHkkf"kr fd;k x;k gSa%&
(1) Rectangles (
)- Entity Set dks iznfkZr fd;k tkrk gSaA
(2) Ellipse (
) blesa Attributes dks iznfkZr fd;k tkrk gSaA
(3) Diamonds ( ):- blds }kjk Entity Set ds e/; Relationship dks lsV fd;k tkrk gSaA
(4) Lines (-):- Entity Set o Entity dks tksM+us ds fy;s Lines dks mi;ksx esa fy;k tkrk gSaA
Customer name

Cust-ID

Customer Street

Account
Number

Balance

Customer City

Account

Customer
Depositor

E-R Model esa fuEu Attributes dks ifjHkkf"kr fd;k x;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. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems

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

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


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

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


(2) Query Processor:- Query Processor Components dks Include fd;k x;k gSa%&
(1) DDL Interpreter:- tks DDL Statement dks Interpreter djrk gSa rFkk mu Statement dh ijhHkk"kk dks Data
Dictionary esa Store djrk gSaA
(2) DMl Compiler:- ;g DML Statements dks Low-level Instruction esa ifjofrZr djus dk dk;Z djrk gSaA
(3) Query Evaluation Engine:- ;g DML Compiler }kjk Generated Low-Level Instruction dks Execute
djus dk dk;Z djrk gSaA
Native
/naiveUs
ers
Use

Application
Programmer

Sophisticated
Users

Write

Application
Interface

Use

Application
Programs

Application
Program
Object Code

Use

Query
Tools

Compiler &
Linker

DML
Queries

Administrator
Tools

DDL Interpreter

DML Compiler
& Organizer

Query Evaluation
Engine

Buffer
Manager

Database
Aministrator

Query Processor

File
Manager

Authorization
Integrity
Manager

Transaction
Manager

Storage Manager

Indices
Data

Data Dictionary
Statistical
Data

Disk Storage

Index

Application Architecture:- Database Applications dks nks Hkkxksa esa foHkDr fd;k x;k gSa%&
(1) Two Tier Architecture
(2) Three Tier Architecture
(1) Two Tier Architecture:- blesa Application dks Component esa ckVk 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;rk ls Access fd;k tkrk gSaA Client o Server ds e/; Interactoin dk dk;Z ODBC (Open Database
Connectivity) ;k JDBC (JAVA Database Connectivity) }kjk fd;k tkrk gSaA
Developed By SMS (The best friends group)
7
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems

USER

USER
Client

Application

Application
Network

Network
Database
System

Server

APPLICATION
SERVER

Database

System
2-Tier Architecture
3-Tier Architecture

(2) 3- Tier Architecture:- blesa Client Machine dh Front end ds :i esa iz;ksx esa fy;k tkrk gS rFkk ;g ekhu
Directly Database Calls dks ugha j[krhA Client ekhu 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;s Three-tier dh
mi;qDr jgrk gSaA ftls www (World Wide Web) ij ju fd;k tk ldrk gSaA
ADVANTAGES & DISADVANTAGES OF DBMS
ADVANTAGES %&
(1) Redundancy Control:- DBMS ds }kjk gj Logical Data Item dks ,d txg LVksj fd;k tkrk gSa ftlls
Information dh vusd Copies ugha curh o T;knk Storage Space Hkh ugha yxrk gSaA ftlls T;knk Updation
dh Problem Hkh ugha vkrhA
(2) Access Control:- Database Administrator lqj{kk (Security) o Authorization dks mi;ksx ds fy;s
miyC/k djokrk gSa vr% DBA ;k Data rFkk User nksuks ij iwjk Control gksrk gSaA
(3) Program Object rFkk Data Structure ds fy;s iw.kZ LVksjst%& Objects ftUgsa Database esas Store fd;k
tkrk gSa ;s Program Execution rFkk Transmination ds fy;s mkjnk;h gksrk gSA Database esa mifLFkr MkVk dks
ckj&ckj dbZ User }kjk mi;ksx esa fy;k tk ldrk gSaA
(4) Multiple User Interface:- gj User Database ls vius Lo;a ds izksxzke o Interface ds vk/kkj ij Interact
djrk gSa bu Interface dks fofHkUu izksxzkfeax Hkk"kkvksa esa develop fd;k tk ldrk gSaA ijUrq mudk Database ls
Compalible gksuk vko;d gSaA
(5) Data dks Enter djus ds fy;s DBMS }kjk cgqr lh lhekvksa dks ifjHkkf"kr fd;k tkrk gSa rFkk bUgsa Process }kjk
mi;ksx Hkh fd;k tkrk gSaA
(6) Backup & Recovery:- DBMS Faliure ds dkj.k dbZ ckj Problem esa vk tkrk gSa] ijUrq DBMS }kjk
Faliure (Hardware ;k Software) ls Recover gksus ds Hkh dbZ lk/ku miyC/k gSa ftlesa MkVk dks Inconsistent
Data esa vkus ls cpk;k tk ldrk gSaA
(7) Data Sharing:- ge tkurs gSa fd DBMS esa MkVk dh flQZ ,d gh dkWih LVksj gksrh gSa blh dkWih dks cgqr ls
Users }kjk mi;ksx esa fy;k tkrk gSaA
(8) Data Abstraction dk xq.k gksus ds dkj.k MkVkcsl ds Structure dks fcuk Users dks ijskku ;k Disturb fd;s
Modification fd;k tk ldrk gSaA
(9) Database gj le; Users dks Latest Information Provide djrk gSaA

Developed By SMS (The best friends group)


8
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


DISADVANTAGES:(1) Database System ds fy;s izkjfEHkd Investment vf/kd gksrk gSa ftlesa Hardware Software o vU;
Trainings Hkh 'kkehy gksrh gSaA vxj Cost High gks rks nwljk rjhdk <w< ysuk pkfg;sA
(2) DBMS ds lkFk vU; mifjO;;ksa tSls Security Concurrency Control, Recovery rFkk Integrity
Constriants vkfn dks Hkh 'kkfey djuk vko;d gksrk gSaA
(3) dqN ifjfLFkfr;k ftlesa Database rFkk mu ij mi;ksx yh tkus okyh Application Simple gks rFkk ,d yEcs le;
rd ;fn mls Change u djuk gks rks DBMS dk iw.kZ mi;ksx ugha fd;k tk,xkA rFkk mlds dqN Features dks
mi;ksx esa ugha fy;k tkrkA
(4) dHkh&2 Database System dks Sigle User ds fy;s gh cuk;k tkrk gSaA blds fy;s Hkh DBMS Suitable ugha gSaA
MPPING CONSTRAINTS:- Enitity rFkk Relationship dks fuEu lhekvksa ds vUrxZr ifjHkkf"kr fd;k tkrk gSa%&
(1) MAPPING CARDINALITIES esfiax dkMZusfyfV
(2) Participation Constraints ikfVZflisku dUlVsaV
(1) MAPPING CARDINALITY:- bUgsa 4 Hkkxksa esa ckVk x;k gSa%&
(1)
One to One:- Entity A vf/kd ls vf/kd B dh ,d Entity ls Connected gks rFkk B dh ,d Entity vf/kd ls
vf/kd A dh ,d Entity ls laca/khr gksA

(2)

a1

b1

a2

b2

a3

b3

ONE to ONE
One to Many:- A dh ,d Entity b dh cgqr lh Entity ls laca/khr gks ldrh gSaA ijUrq b dh ,d Entity vf/kd
ls vf/kd A dh ,d Entity ls gh laca/khr gks ldrh gSaA
a1

b1
b2

a2

b3
b4
b5

a3

(3)

One to Many
Many to One:- A dh ,d Entity vf/kd ls vf/kd B dh ,d Entity ls laca/khr gks ldrh gSaA ijUrq B dh ,d
Entity A dh cgqr lh Entities ls laca/khr gks ldrh gSaA
b1

a1
a2
a3
a4
a5

(4)

b2

b4

Many to One
Many to Many:- 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. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


KEYS:(1) Super Key:- Super Key ,d ;k ,d ls vf/kd Attributes dk lewg gSa ftlls fdlh Entity Set dks Uniquely
fd;k tk ldrk gSA tSls Customer Table ftlesa (Customer ID, Customer Name, Customer City) vkfn gSa ds fy;s
Customer_id Super Key gSa D;ksafd blls Customer Table dks Uniquly Identify fd;k tk ldrk gSaA mlh izdkj
(Customer_id + Customer_name, Customer_id _ Customer_city) Hkh Super Key gSa D;ksafd buls Hkh Customer
Table dks Uniquely Identify fd;k tk ldrk gSaA ijUrq Customer name, Customer City dks Super Key ugha ekuk
tk ldrk D;ksafd Customer dk uke ;k Customer dh City Same gks ldrh gSaA
(2) Candidate Key:- Super dh dk Concept User ds fy;s i;kZIr ugha gksrk gSaA D;ksafd Super Key esa dqN Extra
Attributes dks Hkh 'kkfey 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;k tk ldrk gSaA vr% Customer_id o Customer name + Customer_Street nksuks Candidate Key
gksxhA ijUrq Customer name, Customer City o Customer_id dk Combination Candidate Key ugha gksrk gSaA
(3) Primary Key:- Candidate Key esa ls fdlh ,d Key dks as a Primary Key Choose dj fy;k tkrk gSaA ijUrq
;g ckr /;ku j[kuh vko;d gksrh gSa fd Primary Key esa dHkh Hkh Null Value dks Conidor ugha fd;k tkrk gSaA vr%
Primary Key esa Null Value gks ldrh gSaA
(4) Composite Key:- dHkh&2 Relation ;k Table esa dksbZ Hkh ,d Key ugha gksrh ftls Primary Key cuk;k tk ldsA
vr% nks Attributes dks bdV~Bk dj mls Primary Key cuk;k tkrk gSa mls Comosite Key dgrs gSaA
(5) Foreign Key:- tc fdlh ,d Table dh Primary Key dks nwljh Table esa Hkh iznfkZr djuk gks rks nwljh Table esa
og Primary Key Attribute Foreign Key dgykrk gSaA
E-R Diagram:- E-R Diagram ds }kjk MkVkcsl ds Logical Structure dks Graphically iznfkZr fd;k tkrk gSaA E-R
Model ds dqN rRo fuEu gSa%&
(1) Rectangles:- (
) Entity Set dks blds }kjk iznfkZr fd;k tkrk gSaA
(2) Ellipses:- (
) blds }kjk Attributes dks iznfkZr fd;k tkrk gSaA
(3) Diamonds:- (
):- blds }kjk Relationship Set dks iznfkZr fd;k tkrk gSaA
(4) Lines:- (&&):- Entity o Entity Set ds chp esa Relationship dks Link ds }kjk iznfkZr fd;k tkrk gSaA
(5) Double Ellipses (
):- Multi value Attributes dks iznfkZr fd;k tkrk gSaA
(6) Dashed Ellipses (
):- blds }kjk derived Attributes dks iznfkZr fd;k tkrk gSaA
(7) Double Rectangles:- (
):- Weak Entity Set dks Double Rectangle ds }kjk iznfkZr fd;k tkrk gSaA
E-R Diagram ds }kjk Mapping Eardinality dks Hkh iznfkZr fd;k tk ldrk gSaA
(1) One to One:- iznfkZr djus ds fy, ( ) dks mi;ksx esa ysrs gSaA
(2) One to Many:- iznfkZr djus ds fy, ( ) dks mi;ksx esa ysrs gSaA
(3) Many to One:- iznfkZr djus ds fy, ( ) dks mi;ksx esa ysrs gSaA
(4) Many to Many:- iznfkZr djus ds fy, ( ) dks mi;ksx esa ysrs gSaA
Customer_name

Cust-ID

Customer_Street

Loan
Number

Amount

Customer_City

Loan

Customer
Borrower

One to One

Developed By SMS (The best friends group)


10
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems

Customer_name

Customer_Street

Cust-ID

Loan
Number

Amount

Customer_City

Loan

Customer
Borrower

One to Many
Customer_name

Customer_Street

Cust-ID

Loan
Number

Amount

Customer_City

Loan

Customer
Borrower

Many to One
Customer_name

Cust-ID

Customer_Street

Loan
Number

Amount

Customer_City

Loan

Customer
Borrower

Many to Many
STRONG & WEAK ENTITY SET:- dqN ,sls Entity Set gksrs gSa ftuesa Primary Key dks Define gh ugha fd;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;s mls fdlh nwljh Entity ls dusDV fd;k tkrk gSaA ml Entity Set dks
Identity ;k Owner Entity Set dgk tkrk gSa rFkk og Weak Entity Set Owner Entity Set ij dependent gksrk gSaA
Generalization:- Database design Process dks Bottom up /kkj.kk esa Hkh cuk;k tk ldrk gSa ftlesa Multiple Entity
Sets dks higher Level Entity Set esa muds Common Features ds vk/kkj ij ifjofrZr dj fn;k tkrk gSaA
Agreegation:- blesa fdlh Database Retrieval Process esas No. of Inputs ds vk/kkj ij Single Output Generate
fd;k tkrk gSa tSls ;fn dEiuh esa dke djus okys Employees dh Gross Salary fudkyuh gSa rks No. of Inputs eas lHkh
Employees dh Dalary vk,xh rFkk mldk Output ,d vFkkZr~ Gross Salary gksxkA
Reducing E-R diagrams into Tables:- (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 vyx Vscy esa Store fd;k tkrk gSa] o mls ,d vyx uke ls ifjHkkf"kr djrs gSaA
Developed By SMS (The best friends group)
11
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


E-R Model rFkk Relation Model nksuks gh Relation World Entities dks iznfkZr djrs gSaA vr% nks Model tks ,d ls
design Principles dks Follow djrs gSa vr% E-R Design dks Relational Design esa ifjofrZr dj fn;k tkrk gSaA

NAME
RAM

CUSTOMER
CUST_ID
ADDRESS
404
M.G. ROAD

Relation

CITY
Attributes
JODHPUR
Tuple

Domain

(1)
(2)
(3)
(4)

E-R Diagram ls ifjofrZr Vscy dks Relation dgrs gSaA


Table ds Colums dks Attributes dgk tkrk gSaA
,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. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


UNIT-II
Integrity Rules:- Integrity Constrains ds }kjk ;g Ensure fd;k tkrk gSa fd Authorized Users ds }kjk tc
MkVkcsl esa dqN cnyko fd;s tkrs gSa rks mlls MkVkcsl esa Inconsistency Maintain ugha gksrhA
Integrity Constraints ls eq[; rkRi;Z ;g gSa fd Data dks dqN lhekvksa ds vUrxZr ,d lkFk j[kuk ftlls MkVkcsl esa
Consistency cuh jgsaA
Integrity Constraints dks eq[;r% 4 Hkkxksa eas ckaVk x;k gSa%&
(1) Domain Integrity
(2) Entity Integrity
(3) Referential Integrity
(4) User defined Integrity
(1) Domain Integrity:- 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
;fn fdlh Record ds Particular Domain esa Value ugha Mkyh xbZ gSa rks mlesa Value dks Insert dj fn;k tkrk gSaA
(2) Entity Integrity:- lHkh Real World Objects dks Entity dgk tkrk gSa o gj Entity ,d nwljs ls vyx gksrh gSaA
tc fdlh ,d Entity Set dh Entity esa ,d gh Data Type dh Values fd;k tkrk gSa rks mls Entity Integrity dgk
tkrk gSaA
(3) Referential Integrity:- Referential Integrity Foreign Key ij fuHkZj djrh gSaA tc fdlh Vscy dh Primary
Key Attribute dks fdlh nwljh Vscy esa Hkh Consider fd;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,A bl izdkj ds
Constraint lhek dks Referential Integrity dgk tkrk gSaA
(4) User Defined Integrity:- mijksDr Integrity Constraints ds vykok User dqN vU; Integrity Constraints dks
Hkh Database ij Implement dgk tkrk gSaA tSls Database esa fdlh Hkh Record dks Insert djus ds fy;s 1st Letter dks
Capital fy[kuk vkfnA
RELATIONAL ALGEBRA
(1) Relation Algebra Procedural Query Language gSaA
(2) blesa Input ds :i esa ,d ;k nks Relation dks fy;k tkrk gSa o Result ds :i esa ,d u;k Relation curk gSaA
(3) Relational Algebra ds eq[; Operations Select, Project, Union, Set Difference o Cartesian Product
gSaA
FUNDAMENTAL OPERATION OF RELATIONAL ALGEBRA:(1) Select Project Operations dks Unary Operation dgk tkrk gSa D;ksafd os flQZ ,d Relation ij Operation
Perform djrs gSaA
(2) vU; rhu Operations Union, Set difference o Cartesian Product dks Binary Operations dgk tkrk gSa
D;ksafd bUgsa Perform djus ds fy, nks Relations dh vko;drk gSaA
(1) Select Operation:- Select Operation ds }kjk nh xbZ Condition ds vk/kkj ij Topless dks Select fd;k tkrk
gSaA Selection ds fy;s xzhd Letter Sigma dks mi;ksx esa fy;k tkrk gSa Slect Operation ds lkFk =, #, <, <, >, > vkfnA
Operation dh Hkh mi;ksx esa fy;k tk ldrk gSaA
Selection Operation ds lkFk Logical Operation Perform djus ds fy;s Logical Operator dks mi;ksx esa fy;k tkrk
gSaA blds fy;s and(^), or (v), Not ( ) Symbol dks mi;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. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

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

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


(2) Intersection:- Relational Algebra esa Intersection Operation dks ( ) ds }kjk denote fd;k tkrk gSaA blesa Hkh
duplicates dks Remove dj fn;k tkrk gSaA
tc nks Relation ij Intersection ( ) Operation Perform fd;k tkrk gSa] rks Intersection ,d Relation Display
djrk gSa ftlesa Relation R1 ds os Records tks Relation R2 esa Hkh mifLFkr gks (Common) dks Display fd;k tkrk gSaA
Example:- ;fn Bank ds mu Customer dks Find Out djuk gks ftudk cSad esa ,dkmUV Hkh gks o ftUgksaus cSad ls yksu Hkh
ys j[kk gksA
customer_name (borrower) Customer_name (depositor)
(3) SET- Difference:- Relation Algebra esa Set Difference Operation dks (-) ds }kjk denote fd;k tkrk gSa blesa
Hkh duplicates dks Remove fd;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;k tkrk gSa tks R1 Relation esa rks gSa ijUrq R2 Relation esa ughaA
Example:- cSad ds lHkh Customer Name dh List dks Display djuk ftldk Bank esa Account gks ij mlus cSad ls
yksu ugha fy;k gSa rks blds fy;s fuEu Query dh tk,xhA
customer_name (depositor) - customer_name (borrower)
SQL:- (Structured Query Language):- SQL dks San Jose Laboratory esa IBM }kjk developed fd;k x;k
FkkA SQL dks cgqr ls Parts ls feydj cuk;k x;k gSa%&
(1) DDL (Data Definition Language):- SQL DDL ds }kjk Relation Rchema dks define, delete o
Modify djus ds Commands dks Provide djok;k tkrk gSaA
(2) Interactive DML (Data Manipulation Language):- blesa Tuples dks Insert, delete o Modify djus ds
Commands dks Insert fd;k tkrk gSaA
(3) View Definition:- View define djus ds fy;s SQL DDL esa Commands dks Store fd;k tkrk gSaA
(4) Transaction Control:- Transaction dh Beginning o Ending esa Hkh SQL Commands dks Include fd;k
tkrk gSaA
(5) Authorization:- Relation o View dks Access djus ds fy;s Login Password fn;s tkrs gSaA
Relation Database Relations dk Collection gSa ftlesa gj Relation dks Unique name fn;k tkrk gSa Data base esa
Unknown Values ds Insertion dks jksdus ds fy;s Null Values dks Insert 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:- Select Clause ds }kjk Records dks Display fd;k tkrk gSaA
Example:- ;fn Loan Relation ls lHkh Branch_name dks Display djokuk gSa rks fuEu Query dh tk,xh%&
Select branch_name
From loan
;fn Relation esa ls duplicates dks Rename djuk gks rks distinct Keyword dks Select fd;k tkrk gSaA
Select distinct branch_name
From Loan
(2) Where Clause:- Where Clause esa Relation ls lacaf/kr Conditions dks fy[kk tkrk gSaA
Example:- ;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;s fuEu Query Perform dh tk,xh%&
select loan_no.
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. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


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

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


bl Loss Of Information dks Explain djus ds fy;s o Remove djus ds fy;s Outer Join Operation & Perform
fd;k tkrk gSaA
Outer Join Operation dks 3 Hkkxksa esa ckVk x;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;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;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 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% 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 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. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


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

Developed By SMS (The best friends group)


18
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


mijksDr rhu decomposed Relation gSaA blesa ls (i) Relation esa Loan Amount dks Store ugha fd;k x;k gSa
rks bl izdkj ds Records dks danling Records o tuples dks dangling Tuples dgk tkrk gSa D;ksafd tc Hkh bu rhuksa
Tables dks Join djds data Access fd;k tk,xk rc Record Information v/kwjh izkIr gksxh D;ksafd Loan Amount dks
Insert ugha fd;k x;k gSaA blds fy;s Record Information dks [kkyh u j[kdj Null Value dks Insert dj fn;k tkrk gSa
rFkk bl izdkj ds Relations dks Universal Relation dgk tkrk gSaA ;wfuolZy vr% Null Value dks fcuk Database esa
fdlh Hkh Unknown Value dks Insert ugha fd;k tkrkA
NORMALIZATION:- Normalization ,d oSKkfud fof/k gSa ftlds }kjk Complex Table Structure dks Simple
Table Structure esa ifjofrZr fd;k tkrk gSaA
Table esa ls Redundancy dks de djus o Database Inconsistency dks gVkus ds fy;s dqN Rules dks Follow
dj ukeZykbtsku fd;k tkrk gSaA blesa ;g Hkh /;ku j[kk tkrk gSa fd Normalization ds le; Information dk dksbZ Loss
uk gksA
Normalization ds cgqr ls ykHk gS] ftlds }kjk Fast Sorting, Indexing o Clustering dh tk ldrh gSa o ;g
Table Structure dks Simple cukus dk dk;Z Hkh djrk gSaA fdlh Hkh Database Design dks vPNk cukus ds fy;s fuEu
Rules dks Follow fd;k tkrk gSa%&
(1) gj Table esa ,d Identifier dk gksuk vko;d gSaA
(2) gj Table esa Singal Type dh Entity dks Store fd;k tkuk pkfg;sA
(3) Null Value dks de ls de Store fd;k tkuk pfg;sA
(4) Values dk Repetition iqujko`fr Hkh de ls de gksuk pkfg;sA
Normalization Concept dks Apply djus ds fy;s vyx&2 Normal Forms dks mi;ksx esa fy;k tkrk gSaA Vscy
geskk fdlh u fdlh Normal Form esa gksrh gSaA eq[;r% mi;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):- fdlh Hkh Vscy dks 1NF esa rHkh dgk tk ldrk gSa tc Vscy dh gj Cell esa ,d
Value gksA
Example:- ,d Relation Employee esa fuEu Attributes dks Insert fd;k x;k gSa%&
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
mijksDr Vscy esa lHkh Cell Value dks Insert ugha fd;k x;k gSa ijUrq Projcode Values ,d gh Cell esa ,d ls
vf/kd gSaA vr% ;g Table Normalizaed Form eas ugha gSa] vr% bl ij 1NF ds Rule dks Apply fd;k tk,xk rFkk Table
fuEu izdkj cusxh%&

Developed By SMS (The best friends group)


19
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

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):- dksbZ Hkh Table 2NF esa rHkh gksxh tc og 1NF esa gks rFkk Row dk gj
Attribute Primary Key in Functionally Dependent gksuk pkfg;s u fd Primary dh ds fdlh Part ijA
vr% fdlh Hkh Vscy dks 2NF esa cnyus ds fy;s fuEu fu;eksa dks Follow 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; cps Attributes dks ,d lkFk ,d Vscy esa j[kukA
Example:- Project Table esa fuEu Attributes dks 'kkfey fd;k x;k gSa%&
Project:- (Ecode, Pcode, Dept, 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 ;k Table esa fuEu leL;k gSa%&
(1) fdlh Hkh Employee ds department dh rc rd Store ugha fd;k tk ldrk tc rd fd mls dksbZ Project u
fn;k x;k gksA
(2) Code o Dept. ckj&2 Repeat gks jgs gSa vr% Information Updation esa Hkh Problems vk,xhA ftlls
Inconsistency c<+sxhA
(3) ;fn dksbZ Employee Project Complete dj ysrk gSa rks Employee dk Record ;k Project Delete djus in
iwjk Record Delete gks tk,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. (Non-Key Attribute) dh dependency dks pSd fd;k tk,xkA Ecode ds fy;s Dept dh
Value ,d geskk ,d gS vr% Dept, Ecode in Functionally Dependent gSaA ijUrq Proj Code ds fy;s Dept.
dh Value ,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;s Hours dh ,d ls
T;knk Value gS vr% Hours, Ecode in Functonally Dependent ugha gSaA gj Project ds fy;s ;k Pcode ds fy;s Hkh
Hours dh ,d ls vf/kd Values gSa vr% Hours, Pcode ij Hkh Functionally Dependent ugha gSaA ijUrq tc iw.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. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


vr% Dept ,d ,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;k tk,xkA
(1) Dept = {Ecode, Dept}
(2) Project = {Ecode, Pcode, Hours}
(3) Third Normal Form (3NF):- 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;s fuEu Rules dks Follow fd;k tkrk gS%&
(1) mu Non Key Attributes dks <w<dj Rename djuk tks Primary Key ds vykok ,d nwljs ij Hkh depend
djrk gksA
(2) mu lHkh Attributes dks ,df=r djukA
Example:- ,d Relation Employee esa fuEu Attributes dks 'kkfey fd;k x;k gSa%&
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
mijksDr Relation esa lHkh izdkj dh Anomalies (Problems) mifLFkr gS%&
(1) Updation
(2) Deletion
vr% Table dks 3NF ds fy;s pSd djuk gksxkA bl Vscy ds fy;s Primary Key Ecode gSaA
(1) gj Ecode dh Value ds fy;s Dept dh ,d Value gSa vr% Dept, Ecode in Functionally dependent gSaA
(2) blh izdkj gj Ecode ds fy;s DeptHead Hkh ,d nwljs in Functionally Dependent gSaA vr% bu nksuks
Attributes dks vyx Table esa decompose dj fn;k tk,xkA
vr% ,d Relation nks Parts esa divide gks tk,xk%&
(1) Employee = {Ecode, Dept}
(2) Department = {Dept, Deptifead}
(4) BOYCE-Codd Normal form (BCNF):- dHkh&dHkh 3NF dh ifjHkk"k dqN Tables ds fy;s mi;qDr ugha gksrh
tSls%&
(1) tc Vscy esa ,d ls vf/kd Candidate Keys gksA
(2) tc Multiple Candidate Keys Composite gksA
(3) tc Multiple Candidate Key esa ,d Key Attribute Common gksA
bu lHkh dkj.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. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


bl Table ds fy;s Primary Key Ecode Pcode gSa ijUrq name o Pcode dks Hkh Primary Key pquk tk ldrk
gSa] vr% ;g Candidate Key gSaA
mijksDr Table esa fuEu lwpuk, 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 ,d ,slk Attribute gSa tks Common gSaA
vr% bl Condition esa BCNF dks Apply fd;k tkuk pkfg;s ijUrq lkFk Functional deptendency dks Hkh
check fd;k tkrk gSa%&
(1) Hours Primary Key in Functionally Dependent gSaA
(2) Hours, Name + Pcode ij Hkh Functionally dependent gSaA
(3) Name, Ecode ij Hkh Functionally Dependent gSaA
(4) Ecode Hkh Name ij Functionally Dependent gSaA
vr% BCNF ds fy;s fuEu Rules dks Follow fd;k tk,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; Attributes dks ,d lkFk ,d Table esa j[kukA
vr% Name o Ecode dks vyx Table esa j[kk tk,xk%&
(1) Employee:- Ecode Name
(2) Project:Ecode Pcode Hours
(4) Fourth Normal Form (4NF):- lHkh Normal Form (BCNF) rd Apply djus ij Hkh Relation esa tks
Main Problem jg tkrh gSa og gSa Information dk Repeat gksukA
tc ,d gh Attribute ds fy;s fdlh nwljs Attribute dh ,d ls vf/kd Values gks rks bl izdkj dh leL;k dks nwj
djus ds fy;s Multivalued dependency dks Apply fd;k4 tkrk gSaA ftl Normal Form esa Multivalue
dependency dks Consider fd;k tkrk gSa mls 4NF dgk tkrk gSaA
5NF (PJNF):- tc Relation esa Join dependency dks Consider fd;k tkrk gSa rks bl izdkj dh Normal
Form Project Join Normal Form ;k Fiften Normal Form dgykrh gSaA

Developed By SMS (The best friends group)


22
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


UNIT-IV
INDEXING & HASHING
fdlh Book ;k Card Catalog dh rjg gh Database ds Indexes dks Maintain fd;k tkrk gSaA mnk% ;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
;fn Index Hkh Sorted gks rks Record dks <w<us esa le; de yxrk gSaA eq[;r% nks izdkj Index dks mi;ksx esa fy;k
tkrk gSa%&
(1)
Ordered Index:- ;g Database dh Sorted Values ij fuHkZj djrh gSaA
(2)
Hash Index:- blesa Values dks Bucket esa Uniformly Store fd;k tkrk gSaA Bucket esa fdlh Value dks
Store fd;k tkrk gSa blds fy;s ,d Function dks mi;ksx esa fy;k tkrk gSa ftls Hash Function dgk tkrk gSaA
nksuks izdkj dh Indexing ds fy;s cgqr lh fof/k;k viukbZ xbZ gSa] ijUrq dksbZ Hkh rduhd mi;qDr ugha gSaA gj
Technique dks eq[;r% fuEu Factors ds }kjk ekik tkrk gSa%&
(1)
Access Types:- blesa Records dks fdlh Attribute ls Find fd;k tkrk gSa rFkk lkFk mu Records dks Hkh
Find fd;k tk ldrk gSa tks Specific Range esa vkrk gksA
(2)
Access Time:- fdlh MkVk vkbVe ;k Set on item dks <w<us esa yxk le;A
(3)
Insertion Time:- fdlh u;s Date Item dks Database esa Insert djus esa yxk le;A
(4)
Deletion Time:- fdlh MkVk vkbVe dks Database ls Delete djus esa yxk le;A
(5)
Space Overhead:- Index Structure ds }kjk vfrfjDr mi;ksx esa fy;k x;k LislA
og Attribute ftlds }kjk fdlh QkbZy ds Record dks Search fd;k tkrk gSa] Search Key dgykrh gSaA
Ordered Indexes:- Records dh Fast Searching ds fy;s Index Structure dks mi;ksx esa fy;k tkrk gSaA fdlh
Book ds Index dh rjg gh Ordered Index esa Hkh Search Key Values dks Sorted Order esa ifjHkkf"kr fd;k tkrk gSaA
bl izdkj gh QkbZy dks vyx&2 Search Key ds vk/kkj ij Index fd;k tk ldrk gSaA ;fn fdlh QkbZy esa Records dks
Sequentially j[kk x;k gSa rks Primary Index esa Search Key Values dks Hkh Sequentially Define fd;k tk,xkA
Primary Index dks Clustering Index Hkh dgk tkrk gSaA Primary Index esa eq[;r% Search Key Primary Key gh
gksrh gSaA ijUrq ,slk vko;d ugha gSaA Sequential Order ds vykok ;fn fdlh vU; order dks use esa ysdj Search Key
dks define fd;k x;k gSa] rks ;g Index Secondary Index dgykrk gSaA
(1) Primary Index:- lHkh Files dks fdlh Search Key ds vk/kkj ij Sequentially Ordered fd;k tkrk gSaA os Files
ftlesa Search Key Primary Index ds Concept ij dk;Z djrh gSa mUgsa Index Sequential File dgk tkrk gSaA
DELHI
HYDERABAD

MUMBAI

A-No.
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:- Ordered Index dks eq[;r% nks Hkkxksa esa ckVk x;k gS%&
(1) DENSE INDEX
(2) SPARSE INDEX
Developed By SMS (The best friends group)
23
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


(1) DENSE INDEX:- tc QkbZy dh gj Search Key Value ds fy;s Index Record Maintain fd;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.
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:- ;s Index-Record dqN Serach Key Values dks gh Store djrk gSaA bl izdkj ds Index ls
Record dks Search djus ds fy;s Index Table ls dh mlls cM+h ;k NksVh Value dks Search dj Sequentially
Records dks Search fd;k tkrk gSaA
Sparse Index dh vis{kk Dense Index ls fast searching perform dh tkrh gSA
BIKANER
MADRAS
RURKI

A-No.
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:- ;fn Sparse Index dks mi;ksx esa ysrs gSa rks Records ij Processing ds fy;s Index
Hkh cgqr cM+k gks tkrk gSaA tSls ;fn QkbZy esa 10,00,00 Records gSa rFkk gj Block esa 10 Records dks Store fd;k x;k gSa
o ;fn gj Block ds fy;s ,d Index Record cuk;k x;k gS rks Hkh Index esa 10,000 Records dks LVksj djuk iM+sxkA
Index Records Data Records ls NksVs gksrs gSa vr% ;g eku ysrs gSa fd ,d Block esa 100 Records dks j[kk x;k gSaA
vr% Index dks 100 blocks dh vko;drk gksxh rFkk bu Indexes dks Disk ij Sequential File ds :i esa Store fd;k
tkrk gSaA
;fn Index dh lkbZt NksVh gks o mls Main Memory esa j[kk tk, rks Indexing }kjk Records Searchdjus esa de le;
yxsxkA o ;fn Index cM+k gS rks mls Disk ij j[kk tk,xk ftlls Disk Block Read djus esa le; vf/kd yxsxkA vr%
blds fy;s Binary Search dks mi;ksx esa fy;k tkrk gSaA
vr% bl leL;k dks nwj djus ds fy;s Primary Index ij iqu% Sparse Index cuk;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. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


bl izdkj tc Indexing ds fy;s nks levels dks Create fd;k tkrk gSa o muesa ls fdlh vko;d Block dks gh
Read 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 ;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

(Outer Index)
Main Memory

(Inner Index)
On Disk

SECONDARY INDEX
tc Multilevel Index dks mi;ksx esa fy;k tkrk gSa rks, Index level dks fuEu izdkj ifjHkkf"kr fd;k tkrk gSaA
(1) Inner Index (Primary Index)
(2) Outer Index (Secondary Index)
Secondary Index geskk Dense gksuk pkfg;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 gSaA
Secondary Index ds }kjk Query Performance dks lq/kkjk tkrk gSa] ftlesa Primary Index dh Search Key
Values dks mi;ksx esa fy;k tkrk gSaA
A-No.
A-101
A-217
A-110
A-215
A-102
A-201
A-218
A-222

BRANCH
Amount
DELHI
500
BOMBAY
750
DELHI
600
MADRAS
700
PILANI
400
PILANI
900
RURKI
700
RAJKOT
700
SECONDARY INDEX
B+ TREE INDEX FILES:- Index Sequetial file Organization dh eq[; gkuh ;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;s B+ Tree Index Structure dks mi;ksx esa fy;k tkrk gSa] ftlls QkbZy esa Records dk Insertion o
deletion vklkuh ls fd;k tk ldrk gSaA B+ Tree Index ,d Balanced Tree dh Form esa jgrk gSa ftlesa Root ls
Leaf rd gj Path dh yEckbZ lkeku gksrh gSaA

Developed By SMS (The best friends group)


25
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


B+ Tree Structure Insertion o deletion mifjO;; dks rks Remove dj nsrk gSa ijUrq Space Overhead dks Add dj
nsrk gSa ijUrq ;g mifjO;; vU; mifjO;;ksa ls vf/kd mi;qDr gSaA D;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;ksx esa fy;k tkrk gSaA
blesa B+ tree ds leaf Nodes esa Pointers ds LFkku ij Record dks Store fd;k tkrk gSaA

A,4

B,8

I4

C1

D5

E4

F7

G3

H3

IB
K1

L6

M4

H8

P6

B+ Tree File Organization


B+ Tree esa leaf node esa nonleaf Node ds Point ls] ,d de Records dks j[kk tkrk gSaA B+ Tree Index o B+
Tree File Organization nksuksa esa Insertion o deletion ,d gh izdkj ls fd;k tkrk gSaA ;fn fdlh B+ Tree dks
ifjHkkf"kr fd;k tk, rks fuEu ckrksa dks /;ku esa j[kuk vko;d gSa%&
(1) ;fn n dh Value nh xbZ gS rks mlesa N-1 Value o N Pointers dks j[kk tk,xk tSls%&
;fn N=3 gks o Search Key Branch Name gSa rks ,d Node esa N-1 Values rFkk N= 3 Pointers dks Store fd;k
tk,xkA
Val1

Val 2

2nd Pointer

1 Pointer

3rd Pointer

Leaf Node
Bombay y

Delhi z

A-212 Bombay
A-101 Delhi
A-110 Delhi
B-Tree Index Files:- B-Tree Index fcYdqy B+ Tree Index dh rjg gh gksrh gSaA nksuksa Index Files esa eq[; vUrj
;g gSa fd B-Tree Index esa Search Key Values dh Redundaut (Duplicate) Values dks Remove nwj dj fn;k
tkrk gSaA
B Tree ds }kjk Search Key Values dks ,d ckj gh iznfkZr fd;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. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


Static Hashing:- Sequential File Organization dh ,d deh ;g gSa fd MkVk dks Search djus ds fy;s Index
Structure dks Access fd;k tkrk gSa o blds fy;s Binary Search dks mi;ksx esa fy;k tkrk gSaA ftlls vf/kd
Input/Output Operations dks Perform djuk iM+rk gSaA
ijUrq tc File Organization, Hashing rduhd in fuHkZj djrh gSa rks blls vf/kd I/O Operation dh vko;drk ugha
gksrhA Hashing ds }kjk Hkh Index dks cuk;k tkrk gSaA
Hash File Organization:- bl Organization esa Record dh Search Key Value ij ,d Function QaDku
Perform fd;k tkrk gSaA ftlls vko;d Disk Block ds vko;d Record dks vklkuh ls Search dj fy;k tkrk gSaA
Hashing ds vUrxZr Bucket Keyword dks mi;ksx esa fy;k tkrk gSaA ftlesa ,d ;k ,d ls vf/kd Records dks Store dj
j[kk tkrk gSaA vr% Bucket ,d Disk block tSlk gSaA ysfdu ;g ,d Disk Block ls NksVk ;k cM+k gks ldrk gSaA
ekuk K ds }kjk lHkh Search Key Values dks iznfkZr fd;k tkrk gSa rFkk B }kjk lHkh Bucket Address dks iznfkZr djrk
gSaA Hash Function h ,d Function gSa ftlds }kjk K Search Key Values ls B Bucket ds Specific Record ij
igqpk tkrk gSaA
fdlh Record dks mldh Search Key (k1) ds lkFk Store djus ds fy, ml ij h (Hash Function) (ki) ijQkeZ fd;k
tkrk gSaA tks Record ds Bucket Address dks Return djrk gSaA
bl izdkj Records dks mijksDr fof/k }kjk Delete Hkh fd;k tk ldrk gSaA
Hash Function:- lcls csdkj Hash Function og gSa ftlesa ,d gh Bucket esa lHkh Search Key Value dks j[kk tkrk
gSaA ftlls fdlh Hkh Record dks <<us ds fy;s iwjh Bucket Record dks Search djuk iM+rk gksA
,d vPNk Hash Function ogh gSa ftlesa Key Values dks lHkh Bucket ,d :i esa Store fd;k tk,A vFkkZr~ lHkh
Buckets esa ,d leku Records dks Store fd;k tk,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 x;k gSaA vr% Search
Key Values dks Bucket esa j[kus ds fy;s Hash Function dks mi;ksx fd;k tkrk gSaA Buckets esa Search key Values
dk distribution (forj.k) fuEu izdkj fd;k tkrk gSa%&
(1) forj.k Uniform gksuk pkfg, leku
(2) forj.k Random vleku Hkh gks ldrk gSaA
Bucket Overflow:- tc Record dks Insert fd;k tkrk gSa rks Bucket esa ml Record ds fy;s Space Hkh dh tkrh gSaA
ijUrq ;fn Bucket esa vko;d Space ugha gS] rks Bucket Overflow dh ifjfLFkfr mRiUu gksrh gSaA Bucket Overflow
cgqr ls dkj.kksa ls mRiUu gksrk gSa tks fuEu gSa%&
(1) Insufficient Buckets:- tc iw.kZ :i ls Buckets miyC/k uk gks%& Buckets (nB) geskk nr/fr ls vf/kd gksuh
pkfg;sA ;gk nr- lHkh Records ftUgsa Store djuk gksA fr- ,d Bucket esa fit gksus okys Records dh la[;k vr% nB tc
nr/fr ls vf/kd gksxk rHkh Bucket Overflow dh leL;k dks gVk;k tk ldrk gSaA
(2) Skew Ld;w%& dqN Buckets esa vU; Bucket dh vis{kk T;knk Records dks Store dj fn;k tkrk gSa tcfd nwljh
Buckets esa Space cpk gksrk gSaA bl izdkj dh Condition dks Skew dgk tkrk gSaA Skew eq[;r% nks dkj.kksa ls mRiUu
gksrh gSa%&
1 tc cgqr ls Records dh ,d Search dh gksA
2 tc Hash Function }kjk Search Keys dk vleku forj.k fd;k tk,A
Overflow dks jksdus ds fy;s ;g vko;d gSa fd vU; Buckets dks Allocate dj fn;k tk, Bucket Overflow dks
Overflow Bucket }kjk Hkh nwj fd;k tk ldrk gSaA tSls%& ;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 ;fn Overflow Bucket Hkh Full gks tk, rks System }kjk vU; Overflow Bucket Provide djok nh
tkrh gSaA bl izdkj ;g e pyrk jgrk gSaA lHkh Overflow Buckets dks ml Bucket ds lkFk Link list dh rjg Store
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. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems

Bucket 0

Bucket 1

Bucket 2

Overflow Buckets for Bucket 1

HASH INDICES:- Hasing dks File Organization ds lkFk&lkFk Index-Structure ds fy;s Hkh mi;ksx esa fy;k tk
ldrk gSaA hash index ds }kjk Search Key dks mlds Pointer ds lkFk Hash File Structure esa Store fd;k tkrk gSaA
Dynamic Hashing:- tc Bucket b esa Fix Address dks j[kk tkrk gSaA Static Hashing ds le; dHkh dHkh Serious
Problems Occur gks tkrh gSaA vr% bl izdkj dh Condition Occur uk gks blds fy;s fuEu Option dks mi;ksx esa fy;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 ;g Operation time
Consuming rks gSaA ijUrq Accessing ds fy;s vko;d Hkh gSaA
Dynamic Hashing fof/k;ksa ds }kjk Hash Function dks Database ds c<us ;k de gksus ds lkFk&2 ifjofrZr
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
INDEX DEFINITION IN SQL:- Index Database dh Efficient Processing ds fy;s vko;d gksrs gSa
ftlesa Transaction dks Update fd;k tkrk gSaA o mu ij Queries Hkh Perform dh tkrh gSaA SQL esa Index Create
djus ds fy;s Create Index Command dks mi;ksx esa fy;k tkrk gSaA
Syntax:- Create index <index_name> on
<relation_name> (<attributes>) Attributes esa mu Columns dks 'kkfey fd;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. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


UNIT-V
FALIURE CLASSIFICATION:- (System esa gksus okys Faliure ds Hkkx):- 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 eqfdy ls Recovery dh tkrh gSaA eq[;r% mRiUu gksus okys Faliures fuEu gSa%&
(1) Transaction Faliure:- fdlh Hkh Transaction ds Fail gksus dk dkj.k eq[; nks Errors gks ldrh gSa%&
(1) Logical Error:- tc Transaction dk Execution vf/kd le; rd fdlh Internal vkarfjd Condition
ds dkj.k Normal u jg ik, rks ;g Logical Error dgykrh gSaA tSls%& Data dk uk feyuk , Data dk Oveflow gksuk
vkfnA
(2) System Error:- tc System fdlh vupkgh fLFkfr tSls dead lock dh fLFkfr esa vk tk, o blls
Transaction Normal Execution esa u jgs rks bl izdkj dh Error dks System Error dgk tkrk gSaA
(2) System Crash:- tc Hardware, Database Software ;k Operating System esa Error vk tk, ftlls
Volatile Storage dh Information lqjf{kr uk jgs rks blls Hkh Transaction :d tkrh gSaA
(3) Disk Faliure:- Head ds Crash gksus ;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, j[kus o Failure ls Recovery ds dqN Techniques fof/k;k viukbZ xbZ gSa]
ftUgsa Recovery Alogrithm dgk tkrk gSaA ;s eq[;r% nks izdkj ds gksrs gS%&
(1) Normal Transaction Processing ds fy;s mi;qDr Iformation dk gksuk rkfd Recovery vklkuh ls gks ldsA
(2) Faliure dks Recover djrs le; Database dks Consistent o Atomic cuk, j[krs gSaA
STORAGE STRUCTURE
Storage Media dks mldh Speed {kerk ds vk/kkj in ifjHkkf"kr fd;k tkrk gSaA vr% eq[;r% Storgae nks izdkj ds gksrs gSa%&
(1) Volatile Storage
(2) Non-Volatile Storage
(1) Volatile Storage:- System Crash ds nkSjku Volatile Storage esa j[kh xbZ Information ugha gVrh gSaA Main
Memory ;k Cache Memory bl Storge ds eq[; mnkgj.k gSaA Volatile Storage ls MkVk dks Fastly Access
fd;k tkrk gSaA
(2) Non-Volatile Storage:- System Crash dk Non-Volatile Storage ij vf/kd izHkko iM+rk gSaA Non-Volatile
Storage, Volatile Storage dh vis{kk Slow gksrs gSa D;ksafd Disk ;k Tape (Non-Volatile Storage) Electro
Mechanical bysDVkseSdsfudy gSa tcfd Volatile Storage Chips ds cus gksrs gSaA
Stable Storage:- Stable Storage esa j[kh xbZ Information dk Loss ugha gksrk gSaA
TRANSACTION MODEL
Transaction izksxzke Execution dh ,d ;wfuV gSa ftlds }kjk fofHkUu Data Items dks Access o Update fd;k
tk ldrk gSaA User }kjk Execute dh tkus okyh lHkh Transactions ;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
tkuk vko;d gSa%&
(1)
Atomicity ,VkWfeflVh:- Transaction esa gksus okys lHkh Operations, Database esa lkQ&2 iznfkZr gksus
vko;d gSaA
(2)
Consistency:- tc Database esa dksbZ ,d Transaction Execute gks jgk gks rks nwljk Transaction Execute
ugha gksuk pkfg;s] ftlls Database esa Consistency cuh jgrh gSaA
(3)
Isolation:- tc Database esa Multiple Transaction Execute gks jgh gks rks igyh Transaction ds [kRe gksus
ij gh nwljh Transaction dks Execute gksuk pkfg;sA
(4)
Durability:- tc ,d Transaction iwjh Execute gks tk, rHkh mlls lacaf/kr Updates dks Database esa fd;k
tkuk pkfg;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. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

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;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;k tkrk gSaA
write Database

Data Item

Local Buffer

TRANSACTION STATE:- Faliure u gksus ij lHkh Transaction lQyrkiwoZd iw.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 x;s Changes dks tc Reject dj Transaction dks iwoZ fLFkfr esa ykuk
Transaction Rollback dgykrk gSaA
tc Transaction viuk Execution iw.kZ lQyrkiwoZd dj ysrh gSa] rks mls Transaction dk Commit gksuk dgrs
gSaA
vr% dksbZ Hkh Transaction fuEu esa fdlh Hkh ,d State esa gksuk pkfg;s%&
(1) Active:- izkjfEHkd State, tc Transaction Execute gks jgh gksA
(2) Partially Committed:- tc Transaction dk Last Statement Execute gksA
(3) Failed:- tc ;g irk yx tk, fd vc Transaction dk Normal Execution laHko ughaA
(4) Aborted:- tc lQyrkiwoZd Execution uk gksA
(5) Committed:- tc Transaction dk Execution lQyrkiwoZd gks tk,A
LOG BASED RECOVERY:- Database esa gksus okys ifjorZuksa dks Store djus dk lcls egRoiw.kZ rjhdk Log gSaA
Log esa Log Records j[ks tkrs gSaA eq[;r% Log record esa fuEu Fields dks ifjHkkf"kr fd;k x;k gSa%&
(1) Transaction Identifier:- VkWtsDku vkbMsfUVQk;j ;g Transaction dk ,d Identifier gSa ftlds }kjk
Write Operation Perform fd;k tkrk gSaA
(2) Data Item:- ;g Data Item dh Disk ij fLFkfr dks iznfkZr djrk gSaA
(3) Old Value:- Data Item dh iqjkuh Value Write djus ls igys okyhA
(4) New Value:- Data Item dh u;h Value (Write djus ds ckn dh Value)
Log Record dh Values dks fuEu izdkj ls iznfkZr fd;k tkrk gSaA
(1) Ti <Start> - Ti Transaction
Transaction dk Execution izkjEHk gksus ij Log Record esa Entry.
(2) <Ti, xj, V1, 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> - Transaction ds Commit gksus ijA
(4) <Ti Abort> - Transaction Ti ds Abort gksus ijA
;s Log Records System ;k Disk Faliure ds le; Data Recovery esa lgk;rk iznku djrs gSaA ;s Log
Stable Storage esa Store fd;s tkrs gSaA Transaction dh Atomicity dks cuk, j[kus ds fy;s fuEu nks izdkj ls Log
Records Maintain fd;s tk ldrs gSa%&
Log Records esa lHkh Database Transaction dk iw.kZ Record j[kk tkrk gSaA

Developed By SMS (The best friends group)


30
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


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

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems


(iii) Data Operations ;k Log Records dks Database esa Write djus ls igys lHkh Log Records dk
Stable Storage esa gksuk vko;d gSaA
bl fu;e dks (WAL) Write Ahead Logging dgk tkrk gSaA
Buffered Log dks Disk ij Write djuk Log Force dgykrk gSaA
Database Buffering:- 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;k tkrk gSaA D;ksafd Database
dh vis{kk Main Memory cgqr NksVh gksrh gSaA vr% ;g vko;d gSa fd fdlh nwljs Block dks Memory esa ykus ls igys]
igys Block dks iqu% Disk ij Write dj fn;k tk,A vr% Block b1 ij ;fn Operation Perform gks pqdk gSa rks igys
b1 Block dks ckgj dj Block b2 dks Main Memory esa yk;k tk,xkA blds fy;s Virtual Memory Concept dks
mi;ksx esa fy;k tkrk gSaA blds fy;s fuEu Steps esa Operation Perform fd;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 Block b1 ds }kjk Block b2 dks Call fd;k tkrk gSa rks Hkh B1 ds lHkh Output dks Buffer Use esa
ysdj Stable Storage esa j[k fn;k tkrk gSa rFkk ckn esa Block B2 dks main Memory esa yksM fd;k tkrk gSa] tc b2 dk
dk;Z iw.kZ gks tkrk gSa rks mlds Output dks Stable Storage esa j[k b1 dks Execute fd;k tkrk gSa o var esa Blocks dks
Disk ij fy[k fn;k tkrk gSaA
SHADOW PAGING
(1) Recovery dh ,d vU; fof/k gSa ftls Shadow Paging dgk tkr gSaA
(2) bl Technique esa Database dks Fixed length bbcks esa ckVk tkrk gSa ftUgsa Pages dgrs gSaA (Pages
Operating System dk Concept gSa ftls Memory Management ds fy;s mi;ksx esa fy;k tkrk gSaA
(3) ekuk fd Database dks 1 ton Pages esa ckVk x;k gSa ijUrq ;s Page disk ij fdlh Order e esa ugha gSaA
(4) ;fn Database ds fdlh ist ij Operation djuk gks rks ml ist rd Page Table ds }kjk igqpk tkrk gSaA
(5) Page Table esa N Entries gksrh gSaA gj Entry Database ds ,d Page dks iznfkZr 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 iznfkZr djrh gSa o Second Entry nwljs ist dks iznfkZr djrh gSaA
(8) Shadow Paging rduhd dk eq[; Idea ;g gSa fd blesa nks Page Tables dks Maintain 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;s Current Page Table dks mi;ksx esa 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 gS%&
(1) ;fn ith Page ftlesa X data Item Stored gSa Main Memory esa ugha gS] rks System }kjk lcls igys Input
(x) Operation Perform fd;k tkrk gSaA
(2) ;fn Transaction }kjk bl ith Page ij igyk Write Operation Perform fd;k tk jgk gSa rks System
Current Page Table dks fuEu izdkj ls Change djrk gSa%&
(i) lcls Disk ls ,d Unused Page dks fy;k tk,xkA eq[;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;s ist ij
dkWih djukA
(iii) vc Current Page Table esa ml ith Page dh Entry ds fy;s u;s ist ds Pointer dks Allocate dj fn;k
tk,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
Developed By SMS (The best friends group)
32
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Database Management Systems

1
2
3

.
.
.
.

.
.
.
.

Page Table

Simle Page Table


Pages on disk

Shadow Page Table dks Disk ij Store fd;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;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 ;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

Shadow Page Table


(Disk)

Current Page Table


(Main Memory)
Page disk

Developed By SMS (The best friends group)


33
Keen College Bikener (College of IT & Management) Ph. 9785306009,9983850627,9269069945

PDF Watermark Remover DEMO : Purchase from www.PDFWatermarkRemover.com to remove the watermark

Vous aimerez peut-être aussi