Вы находитесь на странице: 1из 31

www.nskinfo.

com i EDUCATION
CS2255-DATABASE MANAGEMENT SYSTEM
TWO MARKS

UNIT !
INTRODUCTION
!. D"fin" #$%$&$s" m$n$'"m"n% s(s%"m)
Database management system (DBMS) is a collection of interrelated data
and a set of programs to access those data.
2. *is% $n( "i'+% $,,-ic$%ions of DBMS.
a) Banking
b) Airlines
c) Universities
d) Credit card transactions
e) ele comm!nication
f) "inance
g) Sales
h) Man!fact!ring
i) #!man reso!rces
.. W+$% $/" %+" #is$#0$n%$'"s of fi-" ,/oc"ssin' s(s%"m)
he disadvantages of file processing systems are
a) Data red!ndancy and inconsistency
b) Diffic!lty in accessing data
c) Data isolation
d) $ntegrity problems
e) Atomicity problems
f) Conc!rrent access anomalies
1. W+$% $/" %+" $#0$n%$'"s of 2sin' $ DBMS)
he advantages of !sing a DBMS are
a) Controlling red!ndancy
b) %estricting !na!thori&ed access
c) 'roviding m!ltiple !ser interfaces
d) (nforcing integrity constraints.
e) 'roviding back !p and recovery
5. Gi0" %+" -"0"-s of #$%$ $&s%/$c%ion)
a) 'hysical level
b) )ogical level
c) *ie+ level
3. D"fin" ins%$nc" $n# sc+"m$)
Ins%$nc" Collection of data stored in the data base at a partic!lar
moment is called an $nstance of the database.
Sc+"m$ he overall design of the data base is called the data base schema.
4. D"fin" %+" %"/ms
!5 6+(sic$- sc+"m$
25 -o'ic$- sc+"m$.
6+(sic$- sc+"m$ he physical schema describes the database design at
the physical level, +hich is the lo+est level of abstraction describing ho+
the data are act!ally stored.
*o'ic$- sc+"m$ he logical schema describes the database design at the
logical level, +hich describes +hat data are stored in the database and
+hat relationship e-ists among the data.
7. W+$% is conc",%2$- sc+"m$)
he schemas at the vie+ level are called s!bschema.s that describe different
vie+s of the database.
8. D"fin" #$%$ mo#"-)
A data model is a collection of concept!al tools for describing data, data
relationships, data semantics and consistency constraints.
!9. W+$% is s%o/$'" m$n$'"/)
A storage manager is a program mod!le that provides the interface
bet+een the lo+ level data stored in a database and the application programs
and /!eries s!bmitted to the system.
!!. W+$% $/" %+" com,on"n%s of s%o/$'" m$n$'"/)
he storage manager components incl!de
a) A!thori&ation and integrity manager
b) ransaction manager
c) "ile manager
d) B!ffer manager

!2. W+$% is %+" ,2/,os" of s%o/$'" m$n$'"/)
he storage manager is responsible for the follo+ing
a) $nteraction +ith the file manager
b) ranslation of DM) commands in to lo+ level file system commands
c) Storing, retrieving and !pdating data in the database
!.. *is% %+" #$%$ s%/2c%2/"s im,-"m"n%"# &( %+" s%o/$'" m$n$'"/ .
he storage manager implements the follo+ing data str!ct!re
a) Data files
b) Data dictionary
c) $ndices
!1. W+$% is $ #$%$ #ic%ion$/()
A data dictionary is a data str!ct!re +hich stores meta data abo!t the str!ct!re
of the database ie. he schema of the database.
!5. W+$% is $n "n%i%( /"-$%ions+i, mo#"-)
he entity relationship model is a collection of basic ob0ects called
entities and relationship among those ob0ects. An entity is a thing or
ob0ect in the real +orld that is disting!ishable from other ob0ects.
!3. W+$% $/" $%%/i&2%"s) Gi0" ":$m,-"s.
An entity is represented by a set of attrib!tes. Attrib!tes are descriptive
properties possessed by each member of an entity set.
E:$m,-" possible attrib!tes of c!stomer entity are c!stomer name, c!stomer
id, C!stomer Street, c!stomer city.
!4. W+$% is /"-$%ions+i,) Gi0" ":$m,-"s
A relationship is an association among several entities.
E:$m,-" A depositor relationship associates a c!stomer +ith each
acco!nt that he1she has.
!7. D"fin" %+" %"/ms i5 En%i%( s"% ii5 R"-$%ions+i, s"%
En%i%( s"% he set of all entities of the same type is termed as an entity set.
R"-$%ions+i, s"% 2 he set of all relationships of the same type is
termed as a relationship set.
!8. D"fin" sin'-" 0$-2"# $n# m2-%i0$-2"# $%%/i&2%"s.
Sin'-" 0$-2"# $%%/i&2%"s2 attrib!tes +ith a single val!e for a partic!lar entity
are called single val!ed attrib!tes.
M2-%i0$-2"# $%%/i&2%"s 2 Attrib!tes +ith a set of val!e for a partic!lar
entity are called m!ltival!ed attrib!tes.
29. W+$% $/" s%o/"# $n# #"/i0"# $%%/i&2%"s)
S%o/"# $%%/i&2%"s2 he attrib!tes stored in a data base are called stored
attrib!tes.
D"/i0"# $%%/i&2%"s he attrib!tes that are derived from the stored attrib!tes
are called derived attrib!tes.
2!. W+$% $/" com,osi%" $%%/i&2%"s)
Composite attrib!tes can be divided in to s!b parts.
22. D"fin" n2-- 0$-2"s.
$n some cases a partic!lar entity may not have an applicable val!e for an
attrib!te or if +e do not kno+ the val!e of an attrib!te for a partic!lar
entity. $n these cases n!ll val!e is !sed.
2.. D"fin" %+" %"/ms i5 En%i%( %(," ii5 En%i%( s"%
En%i%( %(," An entity type defines a collection of entities that have the
same attrib!tes.
En%i%( s"% he set of all entities of the same type is termed as an entity set.
21. W+$% is m"$n% &( %+" #"'/"" of /"-$%ions+i, s"%)
he degree of relationship type is the n!mber of participating entity types.
25. D"fin" %+" %"/ms
i5 K"( $%%/i&2%"
ii5 ;$-2" s"%
K"( $%%/i&2%" 2 An entity type !s!ally has an attrib!te +hose val!es are
distinct from each individ!al entity in the collection. S!ch an attrib!te is called
a key attrib!te.
;$-2" s"% (ach simple attrib!te of an entity type is associated +ith a
val!e set that specifies the set of val!es that may be assigned to that
attrib!te for each individ!al entity.
23. D"fin" w"$k $n# s%/on' "n%i%( s"%s)
3eak entity set2 entity set that do not have key attrib!te of their o+n
are called +eak entity sets.
Strong entity set2 (ntity set that has a primary key is termed a strong entity set.
24. W+$% #o"s %+" c$/#in$-i%( /$%io s,"cif()
Mapping cardinalities or cardinality ratios e-press the n!mber of entities to
+hich another entity can be associated. Mapping cardinalities m!st be one
of the
follo+ing2
4 5ne to one
4 5ne to many
4 Many to one
4 Many to many
27. E:,-$in %+" %wo %(,"s of ,$/%ici,$%ion cons%/$in%.
4 To%$- he participation of an entity set ( in a relationship set % is
said to be %o%$- if every entity in ( participates in at least one relationship in
%.
4 6$/%i$- if only some entities in ( participate in relationships in %,
the participation of entity set ( in relationship % is said to be ,$/%i$-.
28. D"fin" %+" %"/ms i5 DD* ii5 DM*
DD* Data base schema is specified by a set of definitions e-pressed by a
special lang!age called a data definition lang!age.
DM*
A data manip!lation lang!age is a lang!age that enables !sers to access or
manip!late data as organi&ed by the appropriate data model.
UNIT-II
RE*ATIONA* MODE*
!. W/i%" s+o/% no%"s on /"-$%ion$- mo#"-
he relational model !ses a collection of tables to represent both data
and the relationships amon g those data. he relational model is an
e-ample of a record based model.
2. D"fin" %2,-" $n# $%%/i&2%"
4 A%%/i&2%"s col!mn headers
4 T2,-" 2 %o+
.. D"fin" %+" %"/m /"-$%ion.
%elation is a s!bset of a Cartesian prod!ct of list domains.
1.. D"fin" %2,-" 0$/i$&-"
!ple variable is a variable +hose domain is the set of all t!ples.
5. D"fin" %+" %"/m Dom$in.
"or each attrib!te there is a set of permitted val!es called the domain
of that
attrib!te.
3. W+$% is $ c$n#i#$%" k"()
Minimal s!per keys are called candidate keys.
4. W+$% is $ ,/im$/( k"()
Primary key is chosen by the database designer as the principal means of
identifying an entity in the entity set.
7. W+$% is $ s2,"/ k"()
A super key is a set of one or more attrib!tes that collectively allo+s
!s to identify !ni/!ely an entity in the entity set.
8. D"fin"- /"-$%ion$- $-'"&/$.
he relational algebra is a proced!ral /!ery lang!age. $t consists of a set
of operations that take one or t+o relation as inp!t and prod!ce a ne+
relation as o!tp!t.
!9. W+$% is $ SE*ECT o,"/$%ion)
he select operation selects t!ples that satisfy a given predicate. 3e !se
the lo+ercase letter ss to denote selection. ss

!!. W+$% is $ 6RO<ECT o,"/$%ion)
he pro0ect operation is a !nary operation that ret!rns its arg!ment
relation +ith certain attrib!tes left o!t. 'ro0ection is denoted by pie ( pp pp 5.
!2. W/i%" s+o/% no%"s on %2,-" /"-$%ion$- c$-c2-2s.
he t!ple relational calc!lation is anon proced!ral /!ery lang!age. $t
describes the desired information +ith o!t giving a specific proced!re for
obtaining that
information.
A /!ery or e-pression can be e-pressed in t!ple relational calc!l!s as
6t 7 ' (t)8
+hich means the set of all t!ples9t. s!ch that predicate ' is tr!e for9t..
:otations !sed2
4 t;A< the val!e of t!ple 9t. on attrib!te, A
4 t r t!ple 9t. is in relation 9r.
4 there e-ists
Definition for 9there e-ists. ( )2
t r(=(t))
+hich means there e-ists a t!ple 9t. in relation 9r.
s!ch that predicate =(t) is tr!e.
4 for all
Definition for 9for all. ( )2
t r(=(t))
+hich means =(t) is tr!e for all t!ples 9t. in relation
9r..
4 $mplication
Definition for $mplication ( )2
' = means if ' is tr!e then = m!st be tr!e.
!.. W/i%" s+o/% no%"s on #om$in /"-$%ion$- c$-c2-2s
he domain relational calc!l!s !ses domain variables that take on val!es
from an attrib!te domain rather than val!es for entire t!ple.

!1. D"fin" =2"/( -$n'2$'")
A /!ery is a statement re/!esting the retrieval of information. he
portion of DM) that involves information retrieval is called a /!ery lang!age.
!5. W/i%" s+o/% no%"s on Sc+"m$ #i$'/$m.
A database schema along +ith primary key and foreign key dependencies can
be depicted pictorially b y schema diagram. (ach relation appears as a
bo- +ith attrib!tes listed inside it and the relation name above it.
!3. W+$% is fo/"i'n k"()
A relation schema r> derived from an (% schema may incl!de among its
attrib!tes the primary key of another relation schema r?.this attrib!te is called
a foreign key from r> referencing r?.

!4. W+$% $/" %+" ,$/%s of S>* -$n'2$'")
he S=) lang!age h as several parts2
data @ definition lang!age
Data manip!lation lang!age
*ie+ definition
ransaction control
(mbedded S=)
$ntegrity
A!thori&ation
!7. W+$% $/" %+" c$%"'o/i"s of S>* comm$n#)
S=) commands are divided in to the follo+ing categories2
>. data @ definition lang!age
?. data manip!lation lang!age
A. Data =!ery lang!age
B. data control lang!age
C. data administration statements
D. transaction control statements
!8. W+$% $/" %+" %+/"" c-$ss"s of S>* ":,/"ssion)
S=) e-pression consists of three cla!ses2
Select
"rom
+here
29. Gi0" %+" '"n"/$- fo/m of S>* =2"/()
S"-"c% A , A EEEE., An
> ?
?/o m % , % EEEEE, %
> ? m
W+"/" '

2!. W+$% is %+" 2s" of /"n$m" o,"/$%ion)
%ename operation is !sed to rename both r elations and a attrib!tes. $t !ses the
as cla!se, taking the form2 5ld@name $s ne+@name
22. D"fin" %2,-" 0$/i$&-")
!ple variables are !sed for comparing t+o t!ples in the same relation. he
t!ple
variables are defined in the f/om cla!se by +ay of the $s cla!se.
2.. *is% %+" s%/in' o,"/$%ions s2,,o/%"# &( S>*)
>) 'attern matching 5peration
?) Concatenation
A) (-tracting character strings
B) Converting bet+een !ppercase and lo+er case letters.
21. *is% %+" s"% o,"/$%ions of S>*)
>) Union
?) $ntersect operation
A) he e-cept operation
25. W+$% is %+" 2s" of Union $n# in%"/s"c%ion o,"/$%ion)
Union 2 he res!lt of this operation incl!des all t!ples that are either in r> or
in r? or in both r> and r?.D!plicate t!ples are a!tomatically eliminated.
In%"/s"c%ion he res!lt of this relation incl!des all t!ples that are in both
r> and r?.
.9. W+$% $/" $''/"'$%" f2nc%ions) An# -is% %+" $''/"'$%" f2nc%ions
s2,,o/%"# &(
S>*)
Aggregate f!nctions are f!nctions that take a collection of val!es as
inp!t and ret!rn a single val!e.
Aggregate f!nctions s!pported by S=) are
Average2 avg
Minim!m2 min
Ma-im!m2 ma-
otal2 s!m
Co!nt2 co!nt

!!. W+$% is %+" 2s" of '/o2, &( c-$2s")
G/o2, &( cla!se is !sed to apply aggregate f!nctions to a set of t!ples.
he attrib!tes given in the '/o2, &( cla!se are !sed to form gro!ps.
!ples +ith the same val!e on all attrib!tes in the '/o2, &( cla!se are placed
in one gro!p.
!2. W+$% is %+" 2s" of s2& =2"/i"s)
A s!b /!ery is a select@from@+here e-pression that is nested +ith in
another /!ery. A common !se of s!b /!eries is to perform tests for set
membership, make set comparisons, and determine set cardinality.
!.. W+$% is 0i"w in S>*) @ow is i% #"fin"#)
Any relation that is not part of the logical model, b!t is made visible to a !ser
as a virt!al relation is called a vie+.
3e define vie+ in S=) by !sing the c/"$%" 0i"w command. he form
of the c/"$%" 0i"w command is

C/"$%" 0i"w v as F/!ery e-pressionG
!1. W+$% is %+" 2s" of wi%+ c-$2s" in S>*)
he wi%+ cla!se provides a +ay of defining a temporary vie+ +hose
definition is available only to the /!ery in +hich the wi%+ cla!se occ!rs.
!5. *is% %+" %$&-" mo#ific$%ion comm$n#s in S>*)
Deletion
$nsertion
Updates
Update of a vie+
!3. *is% %+" S>* #om$in T(,"s)
S=) s!pports the follo+ing domain types.
>) Char(n) ?) varchar(n) A) int B) n!meric(p,d)
C) float(n) D) date.
!4. W+$% is %+" 2s" of in%"'/i%( cons%/$in%s)
$ntegrity constraints ens!re that changes made to the database by a!thori&ed
!sers do not res!lt in a loss of data consistency. h!s integrity constraints
g!ard against accidental damage to the database.
!7. M"n%ion %+" 2 fo/ms of in%"'/i%( cons%/$in%s in ER mo#"-)
Hey declarations
"orm of a relationship
!8. W+$% is %/i''"/)
riggers are statements that are e-ec!ted a!tomatically by the system as
the side effect of a modification to the database.
29. W+$% $/" #om$in cons%/$in%s)
A domain is a set of val!es that may be assigned to an attrib!te .all
val!es that appear in a col!mn of a relation m!st be taken from the same
domain.
2!. W+$% $/" /"f"/"n%i$- in%"'/i%( cons%/$in%s)
A val!e that appears in one relation for a given set of attrib!tes also appears
for a certain set of attrib!tes in another relation.
22. W+$% is $ss"/%ion) M"n%ion %+" fo/ms $0$i-$&-".
An assertion is a predicate e- pressing a condition that +e +ish the
database al+ays to satisfy.
Domain integrity constraints.
%eferential integrity constraints
2.. Gi0" %+" s(n%$: of $ss"/%ion)
C/"$%" $ss"/%ion Fassertion nameG c+"ck FpredicateG
21. W+$% is %+" n""# fo/ %/i''"/s)
riggers are !sef!l mechanisms for alerting h!mans or for starting certain
tasks a!tomatically +hen certain conditions are met.
25. *is% %+" /"=2i/"m"n%s n""#"# %o #"si'n $ %/i''"/.
he re/!irements are
Specifying +hen a trigger is to be e-ec!ted.
Specify the actions to be taken +hen the trigger e-ec!tes.
23. Gi0" %+" fo/ms of %/i''"/s)
he triggering event can be insert or delete.
"or !pdated the trigger can specify col!mns.
he referencing old ro+ as cla!se
he referencing ne+ ro+ as cla!se
he triggers can be initiated before the event or after the event.
24. W+$% #o"s #$%$&$s" s"c2/i%( /"f"/ %o)
Database sec!rity refers to the protection from !na!thori&ed access and
malicio!s destr!ction or alteration.
27. *is% som" s"c2/i%( 0io-$%ions Ao/5 n$m" $n( fo/ms of m$-icio2s $cc"ss.
Una!thori&ed reading of data
Una!thori&ed modification of data
Una!thori&ed destr!ction of data.
28. *is% %+" %(,"s of $2%+o/iB$%ion.
%ead a!thori&ation
3rite a!thori&ation
Update a!thori&ation
Drop a!thori&ation
.9. W+$% is $2%+o/iB$%ion '/$,+)
'assing of a!thori&ation from one !ser to another can be represented by
an a!thori&ation graph.
.!. *is% o2% 0$/io2s 2s"/ $2%+o/iB$%ion %o mo#if( %+" #$%$&$s" sc+"m$.
$nde- a!thori&ation
%eso!rce a!thori&ation
Alteration a!thori&ation
Drop a!thori&ation
.2. W+$% $/" $2#i% %/$i-s)
An a!dit trail is a log of all changes to the database along +ith
information s!ch as +hich !ser performed the change and +hen the change
+as performed.

... M"n%ion %+" 0$/io2s -"0"-s in s"c2/i%( m"$s2/"s.
Database system
5perating system
:et+ork
'hysical
#!man
.1. N$m" %+" 0$/io2s ,/i0i-"'"s in S>*)
Delete
Select
$nsert
Update
.5. M"n%ion %+" 0$/io2s 2s"/ ,/i0i-"'"s.
All privileges directly granted to the !ser or role.
All privileges granted to roles that have been granted to the !ser or role.
UNIT-III
DATABASE DESIGN
!. *is% %+" #is$#0$n%$'"s of /"-$%ion$- #$%$&$s" s(s%"m
%epetition of data
$nability to represent certain information.
2. W+$% is fi/s% no/m$- fo/m)
he domain of attrib!te m!st incl!de only atomic (simple, indivisible) val!es.
.. W+$% is m"$n% &( f2nc%ion$- #","n#"nci"s)
Consider a relation schema % and a C % and I C %. he f!nctional
dependency a I holds on relational schema % if in any legal relation
r(%), for all pairs of t!ples t> and t? in r s!ch that
t> ;a< Jt> ;a<, and also t> ;I< Jt? ;I<.
1. W+$% $/" %+" 2s"s of f2nc%ion$- #","n#"nci"s)
o test relations to see +hether they are legal !nder a given set of
f!nctional dependencies.
o specify constraints on the set of legal relations.
5. E:,-$in %/i0i$- #","n#"nc()
"!nctional dependency of the form a I is trivial if I C a. rivial
f!nctional dependencies are satisfied by all the relations.
3. W+$% $/" $:ioms)
A-ioms or r!les of inference provide a simpler techni/!e for reasoning
abo!t f!nctional dependencies.
4. W+$% is m"$n% &( com,2%in' %+" c-os2/" of $ s"% of f2nc%ion$- #","n#"nc()
K he clos!re of " denoted b y " is the set of f!nctional dependencies
logically implied by ".
7. W+$% is m"$n% &( no/m$-iB$%ion of #$%$)
$t is a process of analy&ing the given relation schemas based on their
"!nctional Dependencies ("Ds) and primary key to achieve the properties
Minimi&ing red!ndancy
Minimi&ing insertion, deletion and !pdating anomalies
.
8 D"fin" Bo(c" co## no/m$- fo/m
A relation schema % is in BC:" +ith respect to a set " of f!nctional K
dependencies if, for all f!nctional dependencies in " of the form. a@GI, +here
a
!9. E:,-$in %+" #"si/$&-" ,/o,"/%i"s of #"com,osi%ion.
)ossless@0oin decomposition
Dependency preservation
%epetition of information
!!. W+$% is 2N?)
A relation schema % is in ?:" if it is in >:" and every non@prime attrib!te A
in %
is f!lly f!nctionally dependent on primary key.
UNIT I;

TRANSACTIONS
!. W+$% is %/$ns$c%ion)
Collections of operations that form a single logical !nit of +ork are called
transactions.
2. W+$% $/" %+" %wo s%$%"m"n%s /"'$/#in' %/$ns$c%ion)
he t+o statements regarding transaction of the form2
Begin transaction
(nd transaction
.. W+$% $/" %+" ,/o,"/%i"s of %/$ns$c%ion)
he properties o f transactions are2
Atomicity
Consistency
$solation
D!rability
1. W+$% is /"co0"/( m$n$'"m"n% com,on"n%)
(ns!ring d!rability is the responsibility of a soft+are component of the
base system called the recovery management component.
5. W+"n is $ %/$ns$c%ion /o--"# &$ck)
Any changes that the aborted transaction made to the database m!st be
!ndone. 5nce the changes ca!sed by an aborted transaction have been
!ndone, then the transaction has been rolled back.
3. W+$% $/" %+" s%$%"s of %/$ns$c%ion)
he states of transaction are
Active
'artially committed
"ailed
Aborted
Committed
erminated

4. *is% o2% %+" s%$%"m"n%s $ssoci$%"# wi%+ $ #$%$&$s" %/$ns$c%ion)
Commit +ork
%ollback +ork
7. W+$% is $ s+$#ow co,( sc+"m")
$t is simple, b!t efficient, scheme called the shado+ copy schemes. $t is based
on making copies of the database called shado+ copies that one transaction
is active at a time. he scheme also ass!mes that the database is simply a file on
disk.
8. Gi0" %+" /"$sons fo/ $--owin' conc2//"nc()
he reasons for allo+ing conc!rrency is if the transactions r!n serially,
a short transaction may have to +ait for a preceding long transaction to
complete, +hich can lead to !npredictable delays in r!nning a transaction. So
conc!rrent e-ec!tion red!ces the !npredictable delays in r!nning transactions.
!9. W+$% is $0"/$'" /"s,ons" %im")
he average response time is that the average time for a transaction to be
completed after it has been s!bmitted.
!!. W+$% $/" %+" %wo %(,"s of s"/i$-iB$&i-i%()
he t+o types of seriali&ability is
Conflict seriali&ability
*ie+ seriali&ability
!2. D"fin" -ock)
)ock is the most common !sed to implement the re/!irement is to allo+
a transaction to access a data item only if it is c!rrently holding a lock on that item.

!.. W+$% $/" %+" #iff"/"n% mo#"s of -ock)
he modes of lock are2
Shared
(-cl!sive
!1. D"fin" #"$#-ock)
:either of the transaction can ever proceed +ith its normal e-ec!tion. his
sit!ation is called deadlock.
!5. D"fin" %+" ,+$s"s of %wo ,+$s" -ockin' ,/o%oco-
Lro+ing phase2 a transaction may obtain locks b!t not release any lock.
Shrinking phase2 a transaction may release locks b!t may not obtain any ne+
locks.
!3. D"fin" 2,'/$#" $n# #own'/$#")
$t provides a mechanism for conversion from shared lock to e-cl!sive lock
is kno+n as !pgrade.
$t provides a mechanism for conversion from e-cl!sive lock to shared lock
is kno+n as do+ngrade.
!4. W+$% is $ #$%$&$s" '/$,+)
he partial ordering implies that the set D may no+ be vie+ed as a
directed acyclic graph, called a database graph.
!7. W+$% $/" %+" %wo m"%+o#s fo/ #"$-in' #"$#-ock ,/o&-"m)
he t+o methods for dealing deadlock problem is deadlock detection and
deadlock recovery.
!8. W+$% is $ /"co0"/( sc+"m")
An integral part of a database system is a recovery scheme that can restore
the database to the consistent state that e-isted before the fail!re.
29. W+$% $/" %+" %wo %(,"s of "//o/s)
he t+o types of errors are2
)ogical error
System error
2!. W+$% $/" %+" s%o/$'" %(,"s)
he storage types are2
*olatile storage
:onvolatile storage

22. D"fin" &-ocks)
he database system resides permanently on nonvolatile storage, and is
partitioned into fi-ed@length storage !nits called blocks.
2.. W+$% is m"$n% &( 6+(sic$- &-ocks)
he inp!t and o!tp!t operations are done in block !nits. he blocks
residing on the disk are referred to as physical blocks.

21. W+$% is m"$n% &( &2ff"/ &-ocks)
he blocks residing temporarily in main memory are referred to as b!ffer blocks.
25. W+$% is m"$n% &( #isk &2ff"/)
he area of memory +here blocks reside temporarily is called the disk b!ffer.
23. W+$% is m"$n% &( -o'-&$s"# /"co0"/()
he most +idely !sed str!ct!res for recording database modifications is the
log. he log is a se/!ence of log records, recording all the !pdate activities
in the database. here are several types of log records.

24. W+$% $/" 2ncommi%%"# mo#ific$%ions)
he immediate@modification techni/!e allo+s database modifications to be
o!tp!t to the database +hile the transaction is still in the active state. Data
modifications +ritten by active transactions are called !ncommitted modifications.

27. D"fin" s+$#ow ,$'in'.
An alternative to log@based crash recovery techni/!e is shado+ paging.
his techni/!e needs fe+er disk accesses than do the log@based methods.

28. D"fin" ,$'".
he database is partitioned into some n!mber of fi-ed@length blocks,
+hich are referred to as pages.

.9. E:,-$in c2//"n% ,$'" %$&-" $n# s+$#ow ,$'" %$&-".
he key idea behind the shado+ paging techni/!e is to maintain t+o page
tables d!ring the life of the transaction2 the c!rrent page table and the shado+
p age table. Both the page tables are identical +hen the transaction starts.
he c!rrent page table may b e changed +hen a transaction performs a +rite
operation.

.!. W+$% $/" %+" #/$w&$cks of s+$#ow-,$'in' %"c+ni=2")
4 Commit 5verhead
4 Data fragmentation
4 Larbage collection

... D"fin" '$/&$'" co--"c%ion.
Larbage may be created also as a side effect of crashes. 'eriodically, it is
necessary to find all the garbage pages and to add them to the list of free
pages. his process is called garbage collection.

.1. Diff"/"n%i$%" s%/ic% %wo ,+$s" -ockin' ,/o%oco- $n# /i'o/o2s %wo ,+$s"
-ockin'
,/o%oco-.
$n s%/ic% %wo ,+$s" -ockin' ,/o%oco- all e-cl!sive mode locks taken by a
transaction is held !ntil that transaction commits.
Ri'o/o2s %wo ,+$s" -ockin' ,/o%oco- re/!ires that all locks be held !ntil the
transaction commits.

.5. @ow %+" %im" s%$m,s $/" im,-"m"n%"#
4 Use the val!e of the system clock as the time stamp. hat is a transaction.s
time stamp is e/!al to the val!e of the clock +hen the transaction enters the
system.
4 Use a logical co!nter that is incremented after a ne+ timestamp has been
assignedM that is the time stamp is e/!al to the val!e of the co!nter.

.3. W+$% $/" %+" %im" s%$m,s $ssoci$%"# wi%+ "$c+ #$%$ i%"m)
4 3@timestamp (=) denotes the largest time stamp if any transaction that
e-ec!ted 3%$( (=) s!ccessf!lly.
4 %@timestamp (=) denotes the largest time stamp if any transaction that e-ec!ted
%(AD (=) s!ccessf!lly.
UNIT ;
IM6*EMENTATION TEC@NI>UES
!. Gi0" %+" m"$s2/"s of =2$-i%( of $ #isk.
Capacity
Access time
Seek time
Data transfer rate
%eliability
%otational latency time.

2. Com,$/" s"=2"n%i$- $cc"ss #"0ic"s 0"/s2s /$n#om $cc"ss #"0ic"s wi%+ $n
":$m,-"

s"=2"n%i$- $cc"ss #"0ic"s /$n#om $cc"ss #"0ic"s
M!st be accessed from the beginning $t is possible to read data from any
location
(g2@ tape storage (g2@disk storage
Access to data is m!ch slo+er Access to data is faster
Cheaper than disk (-pensive +hen compared +ith disk

.. W+$% $/" %+" %(,"s of s%o/$'" #"0ic"s)
'rimary storage
Secondary storage
ertiary storage

1. D/$w %+" s%o/$'" #"0ic" +i"/$/c+( $cco/#in' %o %+"i/ s,""# $n# %+"i/ cos%.
Cache
Main memory
"lash memory
Magnetic disk
5ptical disk
Magnetic tapes

5. W+$% $/" c$--"# C2k"&o: s(s%"ms)
N!kebo- systems contain a fe+ d rives and n!mero!s disks that can be loaded into
one of the drives a!tomatically.
3. W+$% is c$--"# /"m$,,in' of &$# s"c%o/s)
$f the controller detects that a sector is damaged +hen the disk is initially
formatted, or +hen an attempt is made to +rite the sector, it can logically map the
sector to a different physical location.

4. D"fin" $cc"ss %im".
Access time is the time from +hen a read or +rite re/!est is iss!ed to +hen data
transfer begins.
7. D"fin" s""k %im".
he time for repositioning the arm is called the seek time and it increases +ith the
distance that the arm is called the seek time.
8. D"fin" $0"/$'" s""k %im".
he average seek time is the average of the seek times, meas!red over a se/!ence
of random re/!ests.

!9. D"fin" /o%$%ion$- -$%"nc( %im".
he time spent +aiting for the sector to be accessed to appear !nder the head is
called the rotational latency time.
!!. D"fin" $0"/$'" -$%"nc( %im".
he average latency time of the disk is one@half the time for a f!ll rotation of the
disk.
!2. W+$% is m"$n% &( #$%$-%/$nsf"/ /$%")
he data@transfer rate is the rate at +hich data can be retrieved from or stored to
the disk.
!.. W+$% is m"$n% &( m"$n %im" %o f$i-2/")
he mean time to fail!re is the amo!nt of time that the system co!ld r!n
contin!o!sly +itho!t fail!re.
!1. W+$% $/" $ &-ock $n# $ &-ock n2m&"/)
A block is a contig!o!s se/!ence of sectors from a single track of one platter.
(ach re/!est specifies the address on
the disk to be referenced. hat address is in the form of a block n!mber.
!5. W+$% $/" c$--"# Co2/n$-in' fi-" s(s%"ms)
"ile systems that s!pport log disks are called 0o!rnaling file systems.
!3. W+$% is %+" 2s" of RAID)
A variety of disk@organi&ation techni/!es, collectively called red!ndant arrays of
independent disks are !sed to improve the performance and reliability.
!4. E:,-$in +ow /"-i$&i-i%( c$n &" im,/o0"# %+/o2'+ /"#2n#$nc()
he simplest approach to introd!cing red!ndancy is to d!plicate every disk.
his techni/!e is called mirroring or shado+ing. A logical disk then consists of
t+o physical disks, and +rite is carried o!t on both the disk. $f one of the disks
fails the data can be read from the other. Data +ill be lost if the second disk
fails before the first fail ed disk is repaired.
!7. W+$% is c$--"# mi//o/in')
he simplest approach to introd!cing red!ndancy is to d!plicate every disk. his
techni/!e is
called mirroring or shado+ing.
!8. W+$% is c$--"# m"$n %im" %o /",$i/)
he mean time to fail!re is the time it takes to replace a failed disk and to restore
the data on it.
29. W+$% is c$--"# &i%--"0"- s%/i,in')
Data striping consists of splitting the bits of each byte across m!ltiple disks. his
is called bit@level striping.
2!. W+$% is c$--"# &-ock--"0"- s%/i,in')
Block level striping stripes blocks across m!ltiple disks. $t treats the array of disks
as a large disk, and gives blocks logical n!mbers.
22. W+$% $/" %+" %wo m$in 'o$-s of ,$/$--"-ism)
)oad Obalance m!ltiple small accesses, so that the thro!ghp!t of s!ch
accesses increases.
'aralleli&e large accesses so that the response time of large accesses is
red!ced
2.. W+$% $/" %+" f$c%o/s %o &" %$k"n in%o $cco2n% w+"n c+oosin' $ RAID
-"0"-)
o Monetary cost of e-tra disk storage re/!irements.
o 'erformance re/!irements in terms of n!mber of $15 operations
o 'erformance +hen a disk has failed.
o 'erformances d!ring reb!ild.
21. W+$% is m"$n% &( sof%w$/" $n# +$/#w$/" RAID s(s%"ms)
%A$D can be implemented +ith no change at the hard+are level, !sing only
soft+are modification. S!ch %A$D implementations are called soft+are %A$D
systems and the systems +ith special hard+are s!pport are called hard+are %A$D
systems.
25. D"fin" +o% sw$,,in')
#ot s+apping permits the removal of fa!lty disks and replaces it by ne+ ones
+itho!t t!rning po+er off. #ot s+apping red!ces the mean time to repair.

23. W+ic+ -"0"- of RAID is &"s%) W+()
%A$D level > is the %A$D level of choice for many applications +ith moderate
storage re/!irements and high $15 re/!irements. %A$D > follo+s mirroring and
provides best +rite performance.
24. Dis%in'2is+ &"%w""n fi:"# -"n'%+ /"co/#s $n# 0$/i$&-" -"n'%+ /"co/#s)
?i:"# -"n'%+ /"co/#s
(very record has the same fields and field lengths are fi-ed.
;$/i$&-" -"n'%+ /"co/#s
"ile records are of same type b!t one or more of the fields are of varying si&e.
27. W+$% $/" %+" w$(s in w+ic+ %+" 0$/i$&-"--"n'%+ /"co/#s $/is" in #$%$&$s"
s(s%"ms)
Storage o f m!ltiple record types in a file.
%ecord types that allo+ variable lengths for one or more fields.
%ecord types that allo+ repeating fields.
28. E:,-$in %+" 2s" of 0$/i$&-" -"n'%+ /"co/#s.
hey are !sed for Storing of m!ltiple record types in a file.
Used for storing records that has varying lengths for one or more fields.
Used for storing records that allo+ repeating fields
.9. W+$% is %+" 2s" of $ s-o%%"#-,$'" s%/2c%2/" $n# w+$% is %+" info/m$%ion
,/"s"n%
in %+" +"$#"/)
he slotted@page str!ct!re is !sed for organi&ing records +ithin a single block.
he header contains the follo+ing information.
he n!mber of record entries in the header.
he end of free space
An array +hose entries contain the location and si&e of each record.

.!. W+$% $/" %+" %wo %(,"s of &-ocks in %+" fi:"# D-"n'%+ /",/"s"n%$%ion)
D"fin"
%+"m.
4 Anchor block2 Contains the first record of a chain.
4 5verflo+ block2 Contains the records other than those that are the first
%ecord o f a chain.


.2. W+$% is known $s +"$, fi-" o/'$niB$%ion)
$n the heap file organi&ation, any record can be placed any+here in the file +here
there is space for the record. here is no ordering of records. here is a single file
for relation.

... W+$% is known $s s"=2"n%i$- fi-" o/'$niB$%ion)
$n the se/!ential file organi&ation, the records are stored in se/!ential order,
according to the val!e of a Psearch keyQ of each record.
.1. W+$% is +$s+in' fi-" o/'$niB$%ion)
$n the hashing file organi&ation, a hash f!nction is comp!ted on some attrib!te of
each record. he res!lt of the hash
f!nction specifies in +hich block of the file the record sho!ld be placed.
.5. W+$% is known $s c-2s%"/in' fi-" o/'$niB$%ion)
$n the cl!stering file organi&ation, records of several different relations are stored
in the same file.
.3. W+$% is $n in#":)
An inde- is a str!ct!re that helps to locate desired records of a relation /!ickly,
+itho!t e-amining all records.
.4. W+$% $/" %+" %wo %(,"s of o/#"/"# in#ic"s)
'rimary inde-
Secondary inde-
.7. W+$% $/" %+" %(,"s of in#ic"s)
5rdered indices
#ash indices
.8. W+$% $/" %+" %"c+ni=2"s %o &" "0$-2$%"# fo/ &o%+ o/#"/"# in#":in' $n#
+$s+in')
Access types
Access time
$nsertion time
Deletion time
Space overhead

19. W+$% is known $s $ s"$/c+ k"()
An attrib!te or set of attrib!tes !sed to look !p records in a file is called a search
key.
1!. W+$% is $ ,/im$/( in#":)
A primary inde- is an inde- +hose search key also defines the se/!ential order of
the file.
12. W+$% $/" c$--"# in#":-s"=2"n%i$- fi-"s)
he files that are ordered se/!entially +ith a primary inde- on the search key are
Called inde-@se/!ential files.
1.. W+$% $/" %+" %wo %(,"s of in#ic"s)
Dense inde-
Sparse inde-
11. W+$% $/" c$--"# m2-%i-"0"- in#ic"s)
$ndices +ith t+o or more levels are called m!ltilevel indices.
15. W+$% $/" c$--"# s"con#$/( in#ic"s)
$ndices +hose search key specifies an order different from se/!ential order of
the file are called secondary indices. he pointers in secondary inde- do not point
directly to the file. $nstead each points to a b!cket that contains pointers to the file.
13. W+$% $/" %+" #is$#0$n%$'"s of in#": s"=2"n%i$- fi-"s)
he main disadvantage of the inde- se/!ential file organi&ation is that
performance degrades as the file gro+s. his degradation is remedied by
reorgani&ation of the file.
14. W+$% is $ BE-T/"" in#":)
A BK@ree inde- takes the form of a balanced tree in +hich every path from the
root of the root of the root of the tree to a leaf of the tree is of the same length.

17. W+$% is B-T/"")
A B@tree eliminates the red!ndant storage of search@key val!es .$t allo+s search
key val!es to appear only once.
18. W+$% is +$s+in')
#ashing allo+s !s to find the address of a data item directly by comp!ting a hash
f!nction on the search key val!e of the desired record.
59. @ow #o (o2 c/"$%" in#": in S>*)
3e create inde- by he create inde- command.
C/"$%" in#": Finde- nameG on Frelation nameG (Fattrib!te listG)
5!. Dis%in'2is+ &"%w""n s%$%ic +$s+in' $n# #(n$mic +$s+in')
S%$%ic +$s+in'
Static hashing !ses a h ash f!nction in +hich the set of b!cket adders is
fi-ed. S!ch hash f!nctions cannot easily accommodate databases that gro+
larger over time.
D(n$mic +$s+in'
Dynamic hashing allo+s !s to modify the hash f!nction dynamically. Dynamic
hashing copes +ith changes in database si&e by splitting and coalescing b!ckets as
the database gro+s and shrinks.
52. W+$% is $ +$s+ in#":)
A hash inde- organi&es the search keys, +ith their associated pointers, into a hash
file str!ct!re.
5.. W+$% c$n &" #on" %o /"#2c" %+" occ2//"nc"s of &2ck"% o0"/f-ows in $ +$s+
fi-"
o/'$niB$%ion)
o red!ce b!cket overflo+ the n!mber of b!cket is chosen to be
(nr1fr)R(>Kd).
3e handle b!cket overflo+ by !sing
4 5verflo+ chaining(closed hashing)
4 5pen hashing
51. Diff"/"n%i$%" o,"n +$s+in' $n# c-os"# +$s+in' Ao0"/f-ow c+$inin'5
C-os"# +$s+in' Ao0"/f-ow c+$inin'5

$f a record m!st be inserted in to a b!cket b, and b is already f!ll, the
system provides an overflo+ b!cket for b, and inserts the record in to the
overflo+ b!cket. $f the overflo+ b!cket is also f!ll, the system provides
another overflo+ b!cket, and so on. All the overflo+ b!ckets of a given
b!ckets are chained together in a linked list, overflo+ handling !sing
linked list is kno+n as closed hashing.
O,"n +$s+in'
he set of b!ckets is fi-ed, and there are no overflo+ chains. $nstead, if a b!cket is
f!ll, the system inserts records in some other b!cket in the initial set of b!ckets.
55. W+$% is -in"$/ ,/o&in')
)inear probing is a type of open hashing. $f a b!cket is f!ll the system inserts
records in to the ne-t b!cket that has space. his is kno+n as linear probing.
53. W+$% is c$--"# =2"/( ,/oc"ssin')
=!ery processing refers to the range of activities involved in e-tracting data from
a database.
54. W+$% $/" %+" s%",s in0o-0"# in =2"/( ,/oc"ssin')
he basic steps are2
'arsing and translation
5ptimi&ation
(val!ation
57. W+$% is c$--"# $n "0$-2$%ion ,/imi%i0")
A relational algebra operation annotated +ith instr!ctions on ho+ to eval!ate is
called an eval!ation primitive.
58. D"fin" =2"/( o,%imiB$%ion.
=!ery optimi&ation refers to the process of finding g the lo+est Ocost method of
eval!ating a given /!ery.

39. W+$% is c$--"# $ =2"/( D":"c2%ion "n'in")
he /!ery e-ec!tion engine takes a /!ery eval!ation plan, e-ec!tes that plan, and
ret!rns the ans+ers to the /!ery.

3!. @ow #o (o2 m"$s2/" %+" cos% of =2"/( "0$-2$%ion)
he cost of a /!ery eval!ation is meas!red in terms of a n!mber of different
reso!rces incl!ding disk accesses, C'U time to e-ec!te a /!ery, and in a
distrib!ted database system the cost of comm!nication

32. *is% o2% %+" o,"/$%ions in0o-0"# in =2"/( ,/oc"ssin'
Selection operation
Noin operations.
Sorting.
'ro0ection
Set operations
Aggregation
3.. W+$% $/" c$--"# $s in#": sc$ns)
Search algorithms that !se an inde- are referred to as inde- scans.
31. W+$% is c$--"# $s ":%"/n$- so/%in')
Sorting of relations that do not fit into memory is called as e-ternal sorting.
35. E:,-$in n"s%"# -oo, Coin)
N"s%"# -oo, Coin consis%s of $ ,$i/ of n"s%"# fo/ -oo,s.
E:$m,-" /F F
s
r is the o!ter relation and s is the inner relation.
33. W+$% is m"$n% &( &-ock n"s%"# -oo, Coin)
Block nested loop 0oin is the variant of the nested loop 0oin +here every
block of the inner relation is paired +ith ever y block of the o!ter relation.
3ith in each pair of blocks ever y t!ple in one block is paired +ith every
t!ple in the other blocks to generate all pairs of t!ples.
34. W+$% is m"$n% &( +$s+ Coin)
$n the h ash 0oin algorithm a hash f!nction h is !sed to implement partition t!ples
of both relations.
37. W+$% is c$--"# $s /"c2/si0" ,$/%i%ionin')
he system repeats the splitting of the inp!t !ntil each partition of the b!ild inp!t
fits in the memory. S!ch partitioning is called rec!rsive partitioning.

38. W+$% is c$--"# $s $n N-w$( m"/'")
he merge operation is a generali&ation of the t+o@+ay merge !sed by the
standard in@memory sort@merge algorithm. $t merges : r!ns, so it is called an :@
+ay merge.
49. W+$% is known $s f2#'" f$c%o/)
he n!mber of partitions is increased by a small val!e called the f!dge factor,
+hich is !s!ally ?S percent of the n!mber of hash partitions comp!ted.
6ART B
UNIT I
INTRODUCTION
>. a. (-plain the architect!re of DBMS (T)
b. Compare "ile systems +ith database systems . (T)
?. 3hat is meant by %elational calc!l!sU =!ery e-amples for t!ple and domain
relational calc!l!sU (>D)
A. (-plain all types of data models (>D)
B. (-plain (@% Model concept and e-tended (@% model. (>D)
C. Define relational algebra. 3ith s!itable e-ample. (>D)
D. %oles of data base administrator and the details of aggregate f!nction /!eries (>D)
V. a. 3ith relevant e-amples disc!ss the follo+ing in S=)
i. DD)
ii. DM)
iii. DC)
iv. *ie+s (T)
b. Constr!ct an (% diagram for a car ins!rance company that has a set of c!stomers,
each of +hom o+ns one1more cars. (ach car has associated +ith it &ero to any
n!mber of recorded accidents. (T)
T. 3rite a note on relational calc!l!s.U #o+ do different schema definition lang!ages
s!pport
this architect!reU
W. Dra+ the (% diagram for hospital management system.
>S.(-plain the A schema architect!re of DBS.3hy do +e need mappings bet+een
different schema levels
>>. Consider the follo+ing tabls2
(mployee ((mpXno, :ame, (mpXcity) e
Company ((mpXno, CompanyXname, Salary)
i. 3rite a S=) /!ery to display (mployee name and company name.
ii. 3rite a S=) /!ery to display employee name, employee city ,company name and
salary of all
the employees +hose salary G>SSSS
iii. 3rite a /!ery to display all the employees +orking in 9YZ[. company.
>?. (-plain vario!s DM) commands +ith neat synta-.
UNIT II
RE*ATIONA* MODE*
>. a) +hat is meant by Selection and pro0ection !sed in %elational algebraU (T)
b) #o+ +e made lossless and loss@0oin in relational modelU (T)
?. a) Define class #ierarchies and AggregationU (T)
A. a)(-plain the strength and +eakness of the riggers mechanism (T)
and !pdate vie+s in stored proced!re.
b)3hat is meant by $ntegrity and sec!rityU (T)
B. Consider the follo+ing relational schema
(mployee (empno,name,office,age)
Books(isbn,title,a!thors,p!blisher)
)oan(empno, isbn,date)
C. 3rite the follo+ing /!eries in relational algebra.
D. a. "ind the names of employees +ho have borro+ed a book
'!blished by McLra+@#ill. (B)
b. "ind the names of employees +ho have borro+ed all books
'!blished by McLra+@#ill. (B)
c. "ind the names of employees +ho have borro+ed more than
five different books p!blished by McLra+@#ill. (B)
d. "or each p!blisher, find the names of employees +ho have borro+ed
More than five books of that p!blisher. (B)
V. (-plain the details abo!t embedded and dynamic S=) (>D)
T. Dra+ a neat sketch to indicate the architect!re of a distrib!ted database system. 3ith
an e-ample e-plain the vario!s form of data fragmentation !sed in DDB.
UNIT III
DATABASE DESIGN
>. 3hat is normali&ationU (-plain all :ormal forms.
?. 3rite abo!t decomposition preservation algorithm for all "D.s.
A. (-plain f!nctional dependency concepts
B. (-plain ?:" and A:" in detail
C. Define BC:" .#o+ does it differ from A:".
D. (-plain the codd.s r!les for relational database design
V. . (-plain the AC$D properties of a transaction
UNIT I;
TRANSACTIONS
>. a) #o+ ransactions are possible in Distrib!ted databaseU (-plain briefly (T)
b) 3hat is ransaction state and its AC$D propertiesU (T)
?. a) Disc!ss abo!t t+o phase locking and commit protocol (T)
b) (-plain vario!s recovery techni/!es d!ring transaction in detail. (T)
A. a)#o+ can +e achieve conc!rrency control achieved in DBMS thro!gh
Seriali&abilityU (T)
b)(-plain %ecovery schemas in detail (T)
B. a) 3hat is deadlock prevention and dead lock detection method (>S)
b) (-plain the deadlock recovery techni/!e (D)
C. (-plain the follo+ing protocols for conc!rrency control
i) )ock based protocols (T)
ii) ime stamp based protocols DAABAS( MA:AL(M(: SZS(M
D. 3hat is conc!rrency controlU ho+ is it implemented in DBMSU (>D)
V. a. 3rite short notes on shado+ paging (T)
b. (-plain the deffered and immediate@modification version of the log@based (T)
recovery scheme
UNIT ;
IM6*EMENTATION TEC@NI>UES
>. a) 3hat is %aidU )ist the different levels in %aid technology and e-plain
its feat!res (T)
b) Disc!ss abo!t primary file storage system (T)
?. (-plain static and dynamic #ashing echni/!esU (>D)
A. Briefly describe abo!t BK tree inde- file str!ct!re. (>D)
B. 3hat are the steps involved in =!ery processingU #o+ +o!ld yo! (>D)
estimate the cost of /!ery.
C. Disc!ss selection operation techni/!es (>D)
D. (-plain str!ct!re of file indices (>D)
V. (-plain different properties of inde-es in detail (>D)
T. 3ith a neat diagram e-plain the steps involved in /!ery process.
W. (-plain in detail abo!t BK tree inde- files.
>S. 3hat is deadlockU (-plain the vario!s approaches !sed to recover from deadlock.

Вам также может понравиться