You are on page 1of 17

Database

Management Systems
(Solutions for Vol‐1_Classroom Practice Questions)

2. ER and Relational Model 07. Ans:


Sol:
1
ssn cid
01. Ans: (b)
Sol: Derived attribute is an attribute that derives
Professor Teaches course
its value from one or more attributes.

02. Ans: (b) semester


Sol: 1:m
Employee Manage Department

ssn cid
03. Ans: (a)
Sol: As every specialized entity is subset of Professor Teaches course
generalized entity, then the deletion of
generalized entity requires the deletion of
specialized entity. semester

04. Ans: (c)


3
Sol: cid
ssn
 Composite attribute is an attribute which
is composed of other attributes. Professor Teaches course
 Multi valued attribute represented with
double ellipse.
 Derived attributes represented with dotted
ellipse semester

05. Ans: (b) 4


Sol: cid
Professor Teaches Course ssn

06. Ans: (a)


Professor Teaches course
M:1
E1  R E2

ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata



: 2 : CSIT‐Postal Coaching Solutions

2. On removal of row (5,2), row (9,5) must


5
also be deleted as it depends on value 5.
ssn gid

13. Ans: 0
Professor Memberof Group
Sol: When <3, 8> is deleted, its related tuples in
T2 is (8, 3) and 3 is to set null. Hence the
Teaches semester number of additional tuples to delete is 0

14. Ans: (a)


course Sol: As the key constraint from professor, the
maximum number of tuples possible in
cid Teaches is number of tuples in professor.
08. Ans: (c)
Sol: Set of attributes which contains a candidate 15. Ans: (a)
key is said to be a super key. Sol:
Professor Teaches Course
09. Ans: (b)
Sol: All the values present in Foreign key must
present in primary key of the referenced 16. Ans: (a)
relation. Sol: As C, A and B in total participation with R1
and R3 and there is key constraint, all these
10. Ans: (c) are represented with one relation and R2 is re
Sol: It violates referential integrity constraint as presented separately one relation.
it is updating in foreign key but not in
primary key. 17. Ans: (b)
Sol: There are some tuples of course may not
11. Ans: (c) participate with any tuple of professor, then
Sol: When parent is update, it requires child table cid is a key for the relation.
to be updated simultaneously
18. Ans: (a)
12. Ans: (c) Sol: (AR1B) will be one table as there is total
Sol: 1. On removal of row (2,4), row (5,2) and participation and key constraint.
(7,2) must also be deleted as they depend on (CR2) will be the second table as there is a
value key constraint.

ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata



: 3 : DBMS

19. Ans: (b) 23. Ans: (c)


Sol: As we get key and participation constraint Sol: Person
has Loan
from course to registration, therefore the
number of tuples in registration will be As there is a key constraint from Loan,
equal to the tuples in the course table. Relationship can be merged with Loan entity
set.
20. Ans: (b)
Sol: Strong entities E1 and E2 are represented as 24. Ans: (b)
separate tables, in addition to that many to Sol: M, P are strong entities hence they must be
many relationship (R2) must be converted as represented by separate tables. M table is
separate table by having primary key of E1 modified to include primary key of P side
and E2 as foreign key. One to many ( i.e P1). N is weak entity, and it is modified
relationship must be transferred to ‘many’ to include primary key of P (i.e P1).
side table by having primary key of one side
as foreign key. Hence we will have 25. Ans: (a)
minimum of 3 tables. Sol: M and P are strong entities hence they must
be represented as separate tables. To include
21. Ans: (b) R1, M table is modified to accommodate
Sol: Strong entities E1 and E2 are converted as primary key of P side (i.e P1) as foreign key.
separate tables. Since A23 is a multi valued N is weak entity, so modify N to
attribute it should also be converted as accommodate primary key of P (i.e P1) as
separate table. Relationship R is transferred foreign key.
to ‘m’ side (E2). Therefore tables are (M1, M2, M3, P1),
(P1, P2), (N1, N2, P1). So correct answer is
22. Ans: 3 (M1, M2, M3, P1).
Sol: E-R model is 26. Ans: (b)
Sol:
Employee manages Department sponsors Project
 An Entity type is represented with one
relation.
The minimum number of relations in  Key attribute becomes primary key for the
relational model is 3. relation
1. (Employee, manages)  Composite attribute is represented with set of
2. Department simple attributes
3. (Project, sponsors)  Weak entity is represented always as a child
table
ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata

: 4 : CSIT‐Postal Coaching Solutions

(FDs) = BCD EA, it includes RHS attributes


3. Functional Dependencies
CD, so it can be derived from FDs AC+ from
functional dependencies
01. Ans: (d)
(FDs) = ACBDE, it includes RHS attributes
Sol: As ‘BC’ is key BC→A is satisfied
BC so it can be derived from FDs

02. Ans: (b)


Sol: Based on the table values given in query and 07. Ans: (c)
guidelines below, answer is b. YZ is having Sol: AC+ contains I then AC→ I dependency is
unique combination, and Y is also having possible.

unique values. Hence YZX, YZ are


08. Ans: 24
possible.
Sol: 24 +24–23=24.

03. Ans: (b)


09. Ans: (b)
Sol: A functional dependency X→Y is satisfied
Sol: As ‘K’ is independent attribute, key is
if any two tuples agree on X then they must
ABDK.
also agree on Y.

10. Ans: (d)


04. Ans: (c)
Sol: ABD+ = A, B, C, D, E.
Sol: AF+ = AFDE not ACDEFG as given.

11. Ans: (b)


05. Ans: (c)
Sol: ACEH+ contains all the attributes of R.
Sol: A functional dependency X  Y is said to
be trivial iff Y  X.
12. Ans: (d)
Sol: Closure of AEH+ = BEH+= DEH += A, B, C,
06. Ans: (b)
D, E, H. If any closure includes all attributes
Sol: CD + from functional dependencies
of a table then it can become candidate key
(FDs) = CDEAB, it includes RHS attributes
of the table. Closure of AEH, BEH, DEH
AC so it can be derived from FDs BD+ from
includes all attributes of table. Hence they
functional dependencies
are candidate keys.
(FDs) = BD only, RHS attributes CD are not
included in the closure hence it cannot be
13. Ans: (b)
derived BC + from functional dependencies
Sol: Set of attributes which contains a candidate
key is called super key.

ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata



: 5 : DBMS

14. Ans: 3 And remaining FD’s are not possible to


Sol: The candidate keys are eliminate
F  5 FD’s are there in minimal cover.
AB
CB 23. Ans: (c)
Sol: The minimal set of F is A→B, B→C
15.
and AB→C is redundant.
Sol: CK: ACD, BCD, ECD.

24. Ans: (a)


16. Ans: 6
Sol: As V → W, delete W from VW → X results
Sol: AB, AD, EB, ED, CB, CD.
in V → X
As V → X, delete X from Y → VX results
17. Ans: 2
in Y → V
Sol: D, AH
The irreducible set is
V→W
18. Ans: (b)
V→X
Sol: The number of super keys are A, B, C, AB,
Y→V
AC, BC, ABC.
Y→Z

19. Ans: (a)


25.
Sol: D→E of F is not covered by G.
Sol: AD  CF

20. Ans: (c) C B Canonical set

Sol: D→C in set2 and C→D in set1 not covered BE


by each other.
26.
21. Ans: (d) Sol: A  BC
Sol: AB→C, A→BC both can be determined AE  H
from remaining set of FD’s. CD Minimal set
DG
22. Ans: 5
EF
Sol: AC → D can be eliminated, it can be
derived from A → B and CB → D using
augmentation and transitive rule.
A → B  AC → BC
 AC → D

ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata



: 6 : CSIT‐Postal Coaching Solutions

R6 (FGH)
4. Normalization
R7 (BF)
01. AB+ is key.
Sol: 1. C.K = BD, Lossy, Dependency preserving
2. C.K = AB, CB, Loss-less, 05.
Not Dependency preserving Sol: Candidate key: AC
3. C.K = A, C, Loss-less, A+ = (ABE) R1, C+ = (CD) R2
Dependency preserving (ACF) R3
4. C.K = A, Loss-less,
Not Dependency preserving 06.
5. C.K = A, Lossy, Sol: (1) C  D
Not Dependency preserving CA
02. Ex: F: {AB→C, A→D} BC
C.K: B, 2NF but not 3NF
03. Ex: F: {AB→C, C→D} (2) 2NF but not 3NF as no partial
dependency CK: BD.
04. (3) R is in 3NF but not in BCNF
Sol: R is in 1NF  decompose to 2NF (4) C.K = A
A+ = {A, D, E, I, J} R1 = 2NF (5) Candidate Keys = AB, CD, BC, AD
B+ = {B, F, G, H} R2 = 2NF R is in 3NF but not in BCNF.
D+
R4 (D I J)
R1 (A D E I J) 07. Ans: (d)
R5 (A E D) Sol: 3NF requires for a non trivial FD of the
F+ form X →A then X is super key (or) A is
R6 (F G H)
R2 (B F G H)
prime attribute.
R7 (B
F)
{A, B, C} R3 BCNF 08. Ans : (a)
Then decompose into 2NF Sol: As given client id and order id together is a
R1 (ADEIJJ) key and it is possible to determine
R2 (BFGH) Firstname, Lastname of a client using his
R3 (ABC) client id, then we have the dependency
3NF also in BCNF clientid → Firstname, Lastname which is a
R3 (ABC) partial functional dependency. Hence the
R4 (DIJ) relation is in 1 NF.
R5 (AED)

ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata



: 7 : DBMS

09. Ans: (b) 02. Ans: (c)


Sol: (Volume, Number)  Year is a partial (10  0  30  0)
avg (marks) =  10
functional dependency. So, the given 4
relation is in 1 NF but not in 2 NF.
03. Ans: (b)
10. Ans: (c) Sol: Select clause contains either aggregate
Sol: R is in 1NF as A→FC and B→E are partial function or the attributes that appear in
dependencies group by clause.

11. Ans: (d) 04. Ans: (c)


Sol: Relation R1 satisfies A→B, B→C and Sol: sum (rating)/count(0) is smaller value than
C→AB dependencies and all the avg(rating).
determinants are super keys. Hence the
relation is in BCNF. 05. Ans: (a)
Sol: If A→B does not hold, we expect some
12. Ans: (c) output.
Sol: In CD→B; B is prime attribute.
06. Ans: (c)
13. Ans: (b) Sol: Union operator eliminates the duplicates.
Sol: rollno, courseid is superkey in rollno,
courseid→email, rollno is prime attribute in 07. Ans: (c)
email→rollno. Sol: The result of the query is

5. Structured Query Language (SQL) e1. empno e2.empno


326 321
01. Ans: (b) 350 323
Sol: The result of the query is 351 323
351 350
A B C
1 4 4 08. 2
2 5 1 Sol: It returns two rows.
Student – Name Sum(P.Marks)
2 5 3
Raj 4
3 5 2 Rohit 2

ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata



: 8 : CSIT‐Postal Coaching Solutions

09. Ans: (c) 14. Ans: (a)


Sol: R1 R1 ⋈ R2 Sol: all(empty) returns true always.
R2
A B
A C A B C
1 5 1 7 15. Ans: (c)
1 5 7
3 7 4 9 3 7 null Sol: Inner Query finds the number of guests
4 null 9
trained by JULIO
10. Ans: 8
Sol: Full outer join of R and S will give T 16. Ans: 7
relation. Here NULL entries are taken for R Sol: The output of the query is ta.player
and S to include all missing instances of Klose
common attribute A while joining R and S. Ronaldo
G muller
Fontaine
11. Ans: (d) Pele
Sol: Inner query retrieves average salary of all Klismann
employees. Outer query computes average Kocsis
salary of all male employees. Therefore it 17. Ans: (d)
retrieves department names where average Sol:
salary of male employees is more than the S1 S2
average salary in the company. Name Age Rank Name Age Rank
A 16 4 A 16 4
12. Ans: (b)
B 17 3 B 17 3
Sol: The condition is B>any (1,2,1,3,2,4) and the
C 15 1 C 15 1
output will be 4.
D 21 6 D 21 6
E 22 7 E 22 7
13. Ans: (d)
Sol: Finds rating and average age of each rating
When the query executes on the above table
of those sailors whose age is >= 18 and there
of data returns A,D,E in the output, those are
is atleast two sailors for each rating.
students with higher rank than all students
with age <18.
The output is
S.rating avg(S.age)
7 40 Exercise - 01
01.
8 40
Sol: Display the details of all hotels, located in
3 45
London

ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata



: 9 : DBMS

02. guest staying in the room, if the room is


Sol: Display name & address of all guests in occupied.
ascending order of their name living in
London. 10.
Sol: Finds total price of all rooms in ‘Grosvenor
03. hotel’ if the room is currently occupied.
Sol: Display the details of all rooms of price
below 40 & type of the room is either ‘D’ or 11.
‘F’ in ascending order of their prices. Sol: Find number of rooms in each hotel located
04. in London.
Sol: Display all booking details whose check out
time not specified. 12.
Sol: Find the maximum number of rooms booked
05. in London of same type
Sol: Finds total price of all rooms of type ‘D’.
A 100(Room Type)
B 200
06. C 150
D 75
Sol: Find the number of guests who have a
booking on 1st august or in the month of Maximum 200. It displays total no. of
august. bookings for the most popular room in city
of London.
07.
Sol: List the type & price of all rooms in 13.
Grosvenor hotel. Sol: Find total price of all rooms, that are not
currently booked in each hotel.
08.
Exercise - 02
Sol: List all the guest details who have a booking
for the current date in “Grosvenor Hotel’ 01.
Select * from guest where guestNo in ( ) &. Sol: SELECT * FROM Patient ORDER BY
hotelNo = ( ) patName.
= operator – when only 1 value is return.
02.
09. Sol: SELECT Count(patientNo), WardNo FROM
Sol: List the details of all rooms at the Contains GROUP BY WardNo;
‘Grosvenor hotel’ including the name of the

ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata



: 10 : CSIT‐Postal Coaching Solutions

03. GROUP BY wardNo, wardType, noOfBeds


Sol: SELECT p.patientNo, p.patName HAVING COUNT(*) > 10
FROM Patient p, Contains c
WHERE c.patientNo = p.patientNo 08.
AND admissionDate = ‘today’. Sol: SELECT * FROM Patient p Left Join
Prescribed pr
04. ON pr.patientNo = p.patientNo.
Sol: SELECT p.patientNo, p.patName FROM
Patient p, Ward w, Contains c
WHERE w.wardNo = c.wardNo 6. Relational Algebra & Calculus
AND c.patientNo = p.patientNo
AND wardName = ‘Surgical’. 01. Ans: (b)
05. Sol: As list1  list2 the result will be equal to
Sol: SELECT p.patName FROM Patient p,
R
Prescribed pr, Drug d list1

WHERE pr.patientNo = p.patientNo


AND pr.drugNo = d.drugNo 02. Ans: (d)
AND drugName = ‘Morphine’. Sol: Relational Algebra eliminate duplicates
always.
06.
Sol: SELECT SUM(((finishDate – startDate) 03. Ans: (c)
*unitsPerDay) * costPerUnit) AS totalCost Sol: If (X=Y)  Z then the expressions to be
FROM Patient p, Prescribed pr, Drug d true.
WHERE pr.patientNo = p.patientNo
AND pr.drugNo = d.drugNo 04. Ans: (c)
AND drugName = ‘Morphine’ Sol: In the order of evaluation, first we perform
AND patName = ‘John Smith’. selection, then we perform perfection.

07. 05. Ans: (a)


Sol: SELECT w.wardNo, wardType, noOfBeds Sol: Π B(r1) – ΠC(r2) =  is always true. Because
FROM Patient p, Ward w, Contains c ‘B’ is foreign key referencing ‘C’ , so ‘C’
WHERE w.wardNo = c.wardNo must be a primary key, ‘B’ cannot have a
AND c.patientNo = p.patientNo value that is not available in ‘C’. Hence
AND admissionDate = ‘today’ operation ΠB(r1)–ΠC(r2) is always .

ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata



: 11 : DBMS

06. Ans: (a) A. Id B.Id X gives 10 rows Condition


Sol: Common column between tables ‘R’ and ‘S’ (cross
product) A. Id B. Id A. Id > 40 V C.Id <15
is attribute B. In table ‘R’ B is primary key 5 rows 2 rows 12 10 
12 99 
(BA, AC). In table ‘S’ B is foreign key 15 10 
so join is performed on attribute B. 15 99 
25 10 
Therefore maximum tuples possible in the 25 99 
output is equal to rows in Table S (as it has 98 10 
98 99 
less number of rows, provided B values are 99 10 
not repeated in table ‘S’). Result contains 7 rows 99 99 

07. Ans: (b) 10. Ans: (a)


Sol: bal < 0 filter rows from account ∞ depositor Sol: Division operator is used to compare a value
from which we can operate on few rows to with all the values of other relation.
filter b city = “Agra”. First expression returns sid’s of sailors who
reserved all boats called Ganga, and its outer
08. Ans: (d) query returns those sailor names.
Sol: Minus operator indicates rows available in
LHS table but not in RHS table. In this 11. Ans: 4
expression, LHS table produces all female Sol: The output of T1 is: courseName
students, RHS table consists students with CA
less marks hence it produces names of all CB
girl students with more marks than all the CC
boy students. the output of T2 is: StudentName
SA
09. Ans: (a) SC
Sol: Apply first cross product then apply filter. SD
Cross product yields 10 rows, then you play SF
filter A.ID>40 or C.ID<15 produces 7 rows.
A  B  A. Id 12. Ans: (c)
12, 15, 25, 98, 99 Sol: P. duration = 3 months selects all projects of
x is cross product followed selection and duration 3 months
T. pname = P.name selects project names in
projection.
the output.

ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata



: 12 : CSIT‐Postal Coaching Solutions

13. Ans: (a)


Sol: SQL, Relational algebra, tuple relational T |  E  Employee 
(b)   M.manager_ name 

calculus and Domain relational calculus all    
T.City  E.City  M  Manager  ' Jones'  E.person _ name
is representing the same. i.e., all these  
  M.person _ name


expressions representing to find the distinct
names of all students who score more than   M.person _ name 
(c)   
90% in the course numbered 107. T |  E  Employee ' Jones'  T.Manager _ name 
   E.Manager _ name 
  

14. Ans: (d)


Sol: Minus operator indicates, rows available in
LHS table but not in RHS table. In this
7. Transactions & Concurrency Control
expression, LHS table produces all female
students, RHS table consists students with
less marks hence it produces names of all 01. Ans: (d)
girl students with more marks than all the Sol: Transaction T3 perform read on A, which is
boy students. updated by T1 and committed before T1
does.
15.
Sol: Result of given query 02. Ans: (a)
P Q U Sol: As R3(x) is dirty operations which read
2 b 5 W1(x) and is committed before T1. Hence
2 b 6 schedule is non-recoverable.
2 c 5
3 d 6 03. Ans: (c)
Sol: A recoverable schedule is one where for
16. Ans: 2 each pair of transactions Ti and Tj such that
Sol: Relational calculus eliminate the duplicates. Tj reads a data item previously written by Ti,
{T/B Book (T.Title = B.Title)} the commit operation of Ti appear before the
read operation of Tj.
17.
Sol: 04. Ans: (c)
Sol: A schedule is said to be strict if a value
T | T  Employee M  Manger 
  written by a transaction T is to be read or
(a)  M.Manager_ name ' Jones'  
 T.Person _ name  M.Person _ name written by another transaction until either T
 
commits or aborts.

ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata



: 13 : DBMS

05. Ans: (d) W3(X), R2(X) are conflicting hence


Sol: A recoverable schedule is one where for serializability says T3 must be before T2 in
each pair of transactions Ti and Tj such that any serial schedule.
Tj reads a data item previously written by Ti, The serial schedule T1, T3, T2 is satisfying
the commit operation of Ti appear before the all the above conditions. Directed graph for
read operation of Tj. the non-serial schedule will also give same
A schedule is said to be strict if a value sequence.
written by a transaction T is to be read or
written by another transaction until either T 09. Ans: (a)
commits or aborts. Sol:
S1:
T1 T2 T3
06. Ans: (b) R(x)
Sol: The number of serial schedules are 2 R(y)
R(x)
The number of concurrent schedules R(y)
(5  3)! R(z)
are   56 W(y)
5!*3!
W(z)
Then, the total number of non serial R(z)
schedules are = (number of concurrent W(x)
schedules – number of serial schedules) W(z)
= 56 – 2 = 54
Precedence graph
07. Ans: (b)
Sol: Every cascadeless schedule is recoverable T1
T2
but need not vice versa.
T3
08. Ans: (a) S1 is conflict serializable to T2T3T1
Sol: R1(X), R1(Y), R3(Y), W2(Y), W1(X),
S2: T1 T2 T3
W3(X), R2(X), W2(X).
R3(Y), W2(Y) are conflicting hence R(x)
R(y)
serializability says T3 must be before T2 in R(y)
any serial schedule. R(z) R(x)
W1(X), W3(X) are conflicting hence R(z)
serializability says T1 must be before T3 in W(x) W(y)
any serial schedule. W(z)
W(z)

ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata



: 14 : CSIT‐Postal Coaching Solutions

12. Ans: (d)


Precedence graph
Sol:
T1 T2 T1 T2 T3
R(A)
T3 W(A)
S2 is not conflict serializable R(A)
W(A)
10. Ans: (d) W(A)
Sol: Option (A)
T1 T2 T3 S1 and S2 are conflict equivalent to serial
R(x) T1 T2 schedule T2, T3, T1.
R(x) S3 is not conflict equivalent as 2RA, 3WA
W(x) R(x) T3
(T2<T3) and 3WA, 2WA (T3<T2) are the
W(x)
conflict operations. There is no serial
Option (B) schedule that satisfies both T2<T3 and
T1 T2 T3 T3<T2.
R(x) T1 T2
R(x)
W(x)
R(x) T3 13. Ans: (b)
W(x) Sol: As there is a cycle in precedence graph, the
Option (C) schedule is not conflict serializable, but
T1 T2 T3 satisfying view rules.
R(x) T1 T2 14.
R(x)
R(x) Sol: (a) Not Conflict Serializable,
W(x) T3
W(x) Not View Serializable,
Option (D) Recoverable, Avoids Cascading aborts,
T1 T2 T3 Not strict.
R(x) T1 T2
(b) Not Conflict Serializable,
W(x)
R(x) R(x) T3 Not View Serializable,
W(x) Conflict Serializable Not strict,
Recoverable, cascading aborts
11. Ans: (c) (c) Conflict Serializable,
Sol: Precedence graph is View serializable,
Serializable,
T1 T2 Recoverable,
Avoids cascading aborts,
T3 Not strict
ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata

: 15 : DBMS

(d) Not Conflict Serializable, 16. Ans: (c)


Views serializable through Thomas write Sol: An older transaction requesting a data item
rule, Serializable, held by an younger Tx need to wait.
Recoverable,
Avoids cascading aborts, 17. Ans: (b)
Not strict Sol: Construct the wait-for-graph, contains edges
from T1→T2, T2→T3, and T4→T2 and
(e) Conflict Serializable,
there is no circular wait, hence no deadlock.
View Serializable,
Serializable, 18. Ans: (d)
Recoverable, Sol: W1(a), R2(a) and W2(b), R1(b) are
Avoids cascading aborts, conflicting, going by the principles of
strict serializability it is not serializable and
(f) Conflict Serializable, cannot occur in 2PL
View serializable,
Serializable,
8. Indexing
Recoverable,
No need cascading aborts, 01. Ans: 400
strict Sol: Blocking factor = 512/20=25
(g) Not Conflict Serializable, Number of data blocks = 10000/25=400
Not View Serializable, In primary index, the number of index
Not Serializable, records= 400 which is number of blocks in
Recoverable, multi level index.
No need cascading aborts,
02. Ans: (c)
strict
Sol: Since block size is 210 (=1024 bytes),
2m  2n = 210. Only option (c) satisfies with
(i) Conflict Serializable,
m = 8 and n = 2.
View Serializable,
Serializable,
03. Ans: 50
Not Recoverable,
Sol: Order of non-leaf node is
Not Avoid cascading aborts,
(n8) + (n–1) 12  1024
Not Strict
8n + 12n – 12  1024
20n  1036
15. Ans: (c)
n  51
maximum number of keys possible is :50
ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata

: 16 : CSIT‐Postal Coaching Solutions

04. Ans: 52 09. Ans: (d)


Sol: Key =8 Block size = 512, Sol: Deleting ‘10’ from internal node requires 10
Block pointer = 2 bytes, the order of B+ tree to be replaced with copy of 13.
is maximum number of block pointers in it.
(Let ‘n’) 10. Ans: (a)
n * 2 + (n – 1) 8  512 Sol: Insert 15
2n + 8n – 8  512 40

10n  520
15 30 50
n  52

10 15 20 30 40 50
05. Ans: (c)
Sol: n*5+(n–1)*(10+8) 512 Insert 25

5n+16n–18  512 20 40

23n  530
15 30 50
n  23.

10 15 20 25 30 40 50
06. Ans: (b)
Sol: n  P + (n-1)k <=B. Where n is order of the
11. Ans: (a)
tree, P is block pointer, k is key value and B
Sol: If we remove K50 in index node, there is no
is block size.
change in height as still root, index and leaf
Therefore n  6 + (n – 1)9 <=1024.
nodes exist.
n = 1033/16 = 64 (approximately)
Leaf nodes are now, after Delete 50, the B+
is:
07. Ans: 5
Sol: The nodes to access all records with a 20
“search key greater than or equal to 7 and
15 30
less than 15” is (9), (5), (5, 7) (9, 11) and
(13, 15).
10 15 20 25 30 40

08. Ans: (b)


Sol: The resultant tree after the insertion is 10 15 20 25 30 40

Hence Root now consists: 20


40 45
(i) is true, (ii) is true but (iii) is not true
30 40 45 50

ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata

You might also like