Advanced DBMS Sheet - 2022
Advanced DBMS Sheet - 2022
Years Marks
2015 6
2016 5
2017 8
2018 6
2019 4
2020 7
2021Set-1 10
2021Set-2 7
Data for the next five question. Consider the following definition of tables and snapshot of
the tables:
Definition of tables:
CREATE TABLE EMPLOYEE (EMP_ID NUMBER, EMP_NAME VARCHAR2(20),
JOBVARCHAR2(20), MANG_ID NUMBER, SALARY NUMBER, DEPT_ID VARCHAR2(20),
PRIMARY KEY (EMP_ID), FOREIGN KEY MANG_ID) REFERENCES EMPLOYEE
(EMP_ID));
Q10. [MSQ]
Which of following query display name of the employees who does not work in the
departments where there exists the manager with employee_id within the range 7600
and 7700?
(a) SELECT Emp_Name FROM Employee WHERE Emp_ID NOT IN (Select
Emp_ID from Employee where Job = 'MANAGER' and Emp_ID Between
7600 and 7700);
(b) SELECT Emp_Name FROM Employee WHERE Dept_ID NOT IN (Select
Dept_ID from Employee where Job = 'MANAGER' and Emp_ID
Between 7600 and 7700);
(c) SELECT Emp_Name, Dept_ID FROM Employee e1 WHERE NOT EXISTS
(Select * from Employee e2 where e2.Job = 'MANAGER' and
e2.Emp_ID Between 7600 and 7700 and e2.Dept_ID = e1.Dept_ID);
(d) None of the above
Q12. [MSQ]
Which of following query display name of the employees with second highest salary in
their department?
(a) SELECT Emp_Name FROM Employee
WHERE (dept_id, Salary) = Any (SELECT e1.dept_id,
MAX(e1.salary) FROM employee e1 WHERE salary < (SELECT
MAX(salary) FROM employee e2 WHERE e2.dept_id = e1.dept_id)
GROUP BY e1.dept_Id);
(b) SELECT Emp_Name FROM Employee
WHERE (dept_id, Salary) IN (SELECT dept_id, max(salary) FROM
employee WHERE salary NOT IN (SELECT max(salary) FROM
employee GROUP BY dept_id) GROUP BY dept_id);
(c) SELECT salary, dept_id FROM employee e1
WHERE 2 = (SELECT COUNT(DISTINCT(salary)) FROM employee e2
WHERE e1.salary <= e2.salary GROUP BY dept_id);
(d) None of the above
Q14. Which of following query display the name and job of all employees whose salary is
smaller than any salary of employees whose job is Manager.
(a) SELECT Emp_name, Job FROM employee WHERE Salary < Any (SELECT
salary FROM employee WHERE job = 'MANAGER');
(b) SELECT Emp_name, Job FROM employee e1 WHERE Exists (SELECT *
FROM employee e2 WHERE e2.job = 'MANAGER' and e1.salary <
e2.salary);
(c) SELECT Emp_name, Job FROM employee WHERE Salary < Any (SELECT
salary FROM employee WHERE job = 'MANAGER') and Job <>
'MANAGER';
(d) None of the above
Q28. Which of the following queries find the enames of managers who manage the
departments with the largest budgets?
(a) SELECT E.ename
FROM Emp E, Dept D
WHERE E.eid = D.managerid
AND D.budget = (SELECT MAX(D1.budget) FROM Dept D1)
(b) SELECT E.ename
FROM Emp E
WHERE E.eid IN(SELECT D.managerid FROM Dept D
WHERE D.budget = (SELECT MAX(D2.budget)
FROM Dept D2))
(c) SELECT E.ename
FROM Emp E
WHERE E.eid IN (SELECT D.managerid FROM Dept D
WHERE NOT EXISTS (SELECT * FROM Dept D1
WHERE D1.budget > D.budget))
(d) None of the above
Q29. Which of the following query find the distinct managerids of managers who control the
largest amounts?
(a) SELECT DISTINCT D.managerid FROM Dept D
WHERE D.budget = (SELECT MAX(SUM(D1.budget))
FROM Dept D1 WHERE D1.managerid =
D.managerid)
Data for the next five questions. Consider the following relational schemas:
Book(ISBN, Book_Title, Book_Author, Num_of_Pages, Book_Year, C_ID,
P_ID)
Reader (Reader_ID, First_Name, Last_Name, City, DOB)
Publisher (P_ID, P_Name, P_City)
Ratings (R_ID, ISBN, Rating, R_Date)
Category (C_ID, C_Name)
Reading (Reader_ID, ISBN)
Reviewer (R_ID, R_Name)
Q30. Consider the following SQL query on the above database:
(SELECT Book.ISBN, Book.Book_Title, rating
FROM Book, ratings
WHERE ratings.ISBN = book.ISBN)
MINUS
(SELECT Book.ISBN, Book.Book_Title, rating
FROM Book, (SELECT R1.ISBN, R1.rating
FROM Ratings R1, Ratings R2 WHERE R1.ISBN = R2.ISBN
AND R1.rating < R2.rating) Stars
WHERE Book.ISBN= Stars.ISBN.)
the above query returns the
(a) average number of stars received by each book.
(b) lowest number of stars received by each book.
(c) total number of stars received by each book.
(d) highest number of stars received by each book.
Q32. Which of the following query will display the name of publisher which publishes
highest number of books with rating 5?
(a) SELECT p.P_name, COUNT(P_Name)
FROM Publisher p, Ratings r, Book b
WHERE r.rating = 5 AND p.P_ID = b.P_ID AND b.ISBN = r.ISBN
GROUP BY p.P_Name
HAVING COUNT(P_Name) = (SELECT MAX(COUNT(P_Name)) FROM Book
GROUP BY P_Name);
Data for the next three questions. Consider the following relations schema containing ebay
system information:
qty: integer)
Q41. Which of the following TRC query find the ID’s of customers who bought ≥ 2 of the
same item or bought an item that a seller had with quantity 1?
(a) {R|∃P ∈ Purchases(P.count ≥ 2 ∧ (∃I ∈ Items(P.itemID = I.itemID
∧ I.qty = 1)))}
(b) {R|∃P ∈ Purchases(P.count ≥ 2 ∨ (∃I ∈ Items(P.itemID = I.itemID
∧ I.qty = 1)))}
(c) {R|∃P ∈ Purchases((P.count ≥ 2 ∧ (∃I ∈ Items(P.itemID = I.itemID
∧ I.qty = 1)) ∧ (R.custID = P.custID))}
(d) {R|∃P ∈ Purchases((P.count ≥ 2 ∨ (∃I ∈ Items(P.itemID = I.itemID
∧ I.qty = 1)) ∧ (R.custID = P.custID))}
Q42. Which of the following TRC query find the ID’s of items which are stocked by ≥ 2
sellers?
(a) {R|∃I1, I2 ∈ Items(I1.itemID = I2.itemID
∧ I1.sellerID = I2.sellerID ∧ R.itemID = I1.itemID}
(b) {R|∃I1, I2 ∈ Items(I1.itemID = I2.itemID
∨ I1.sellerID = I2.sellerID ∨ R.itemID = I1.itemID}
(c) {R|∃I1, I2 ∈ Items(I1.itemID = I2.itemID
∧ I1.sellerID ≠ I2.sellerID ∧ R.itemID = I1.itemID}
(d) {R|∃I1, I2 ∈ Items(I1.itemID = I2.itemID
∨ I1.sellerID ≠ I2.sellerID ∨ R.itemID = I1.itemID}
Q46. What will be the relational algebra query equivalent to the following statement?
"Names of all doctors available in Peerless"
Q47. Consider the relations STUDENT(ID, RANK, MARKS, SCHOOL). What will be the
relational algebra query equivalent to the following statement?
"Ranks of all students of ABS International school, whose marks is greater than 80"
Which of the following query(s) is/are find the cids of cars that are reserved by a
driver with a rating of at least 5 as well as a driver named Abby?
(a) cid((σdname='Abby'(Drivers)) ⨝ Reserves) ∩ cid((σrating ≥ 5(Drivers))
⨝ Reserves)
(b) cid((σdname='Abby'(Drivers)) ⨝ Reserves) ∪ cid((σrating ≥ 5(Drivers))
⨝ Reserves)
(c) cid((σrating ≥ 5 AND dname ='Abby'(Drivers)) × Reserves)
(d) cid((σrating ≥ 5 AND dname ='Abby'(Drivers)) ⨝ Reserves)
Q53. Consider a relation R with 2d attributes (d is an integer ≥ 2) that are named A1,
A2,..., A2d. There is a set F of 2d FDs on R: Ai → A1+(i+1) mod 2d, for i = 1 . . . 2d. For
example, suppose d = 2, the attributes are A1, A2, A3, A4 and F = {A1 → A3, A3
→ A1, A2 → A4, A4 → A2}. Suppose d = 4, What is the number of keys in
R?___________
Q55. [MSQ]
Which of the following statement(s) regarding the Boyce-Codd normal form (BCNF)
is(are) correct?
(a) A relation in BCNF does not have anomalies of any kind.
(b) A relation in BCNF does not have anomalies caused by functional dependencies.
(c) For each functional dependency, the determinant must be a super key.
(d) A relation in BCNF does not have anomalies caused by transitive dependencies.
Q56. If a table R has only one candidate key, then which of the following is always true?
(a) If R is in 2NF, it is also in 3NF
(b) If R is in 3NF, it is also in BCNF
(c) If R is in 2NF, but is not in 3NF
(d) None of these
Q57. A key is simple if it consists of only one attribute. If every key of table R is simple key,
then which of the following is always true?
(a) If R is in 2NF, it is also in 3NF
(b) If R is in 3NF, it is also in BCNF
(c) R is in 2NF, but is not in 3NF
(d) None of these.
Q58. [MSQ]
Let F be a set of functional dependencies on a table R, and let X + denote the closure of a
set of attributes X. Which of the statements below is/are true?
(a) For any two sets X, Y: (X ∪ Y)+ = X+ ∪ Y+
(b) For any two sets X, Y: if X Y then X+ Y+
(c) For any two sets X, Y: if X+ = X and Y+ = Y then (X ∩ Y)+ = X ∩ Y
(d) None of the above
Q61. [MSQ]
Consider the following set of FDs on R (P, Q, S, T, U, V)
PQ → S PS → Q PT → U Q→T QS → P U→V
Which of the following statements is/are true?
(a) Given FD set is a minimum cover
(b) The decomposition {PQ, QS, PQTU, UV} lossless
(c) The decomposition {PQ, QS, PQTU, UV} is not dependency preserving.
(d) The decomposition {PQS, PSTU, PTV} is dependency-preserving
If (Pet_Name, Breed) is a key for this instance, what may be the value of X?
(a) Beagle.
(b) Pug.
(c) Labrador.
(d) Either Beagle or Labrador.
Q69. Consider the relation T with attributes A, B, C, D, E, F, and G and with the following
functional dependencies (FDs):
A→B BD → F AC → E →D
Unfortunately, we do not know what '' is. It could be any nonempty subset of T's
attributes. (In particular, '' might even contain D itself, which would make →D a
trivial dependency.)
Which of the following must be true, regardless of what is inside ''?
(a) A and G must be in any key.
(b) C and D must be in all keys.
(c) A and E must be in all key.
(d) A can never be in a key with G.
Q72. Consider the relational schema R = {A,B,C,D,E,F,G,H} and the set of functional
dependencies FD:
A → E, BE→ D, AD →BE, BDH→ E, AC→ E, F→ A, E →B, D →H, BG →F, CD →A
Which of the following is a minimum cover of the FD?
(a) A→E, E→D, BD→E, F→A, E→B, D→H, BG→F, CD→A
(b) A→E, E→D, BD→E, F→A, E→B, D→H, BG→F, CD→A, AD→B
(c) A→E, BD→E, F→A, E→B, D→H, BG→F, CD→A, AD→B
(d) A→E, E→D, B→E, F→A, E→B, D→H, BG→F, CD→A
Q73. Consider the universal relation R = {A, B, C, D, E, F, G, H, I, J} and the set of functional
dependencies F: {AB → C, A → DE, B → F, F →GH, D → IJ}. If we decompose above
relation into 3NF using standard algorithm, then minimum numbers of relations will
be__________.
Q74. [MSQ]
Consider the universal relation R = {A, B, C, D, E, F, G, H, I, J} and the set of functional
dependencies F {AB → C, A → DE, B → F, F → GH, D → IJ}. If we decompose above
relation into BCNF using standard algorithm, then which of the following set of
relations are possible:
(a) (A, D, E) (B, F) (F, G, H) (D, I, J) (A, B, C)
(b) (A, D, E) (B, F) (D, I, J) (A, B, C)
(c) (A, D, E) (D, I, J) (A, B, C)
(d) None of the above
Q76. Let R(A, B, C, D, E, F) be a relational schema in which the following FDs are known to
hold:{AB → C, AC → B, AD → E, BC → A, B → F }. Suppose we decompose the
relation R into two relations, R1(AB), R2(BC), R3(ABDE) and R4(EF). The above
decomposition is:
(a) Dependency preserving and lossless join
(b) Lossless join but not dependency preserving
(c) Dependency preserving but not lossless join
(d) Not dependency preserving and not lossless join
Q77. Assume you have a table Employee with the following fields {SSN, LastName, Sex,
Email, DeptCode, DeptName, DeptLocation}. What problem would occur when
deleting employees from this table that is not in third normal form?
(a) You might delete an employee you didn’t mean too
(b) If the employee you are deleting is the last employee in a department, then when
you delete that employee, you also accidentally lose all information about that
department
(c) You can no longer delete employees by using referencing their department code
(d) No problems occur when you do deletions from a table that is NOT in third normal
form
Q79. [MSQ]
If we put the above relation R into 3NF, we will end up with a total number of
____________ relations.
(a) 7 (b) 8 (c) 9 (d) 10
Q80. [MSQ]
Consider the following collection of relations and dependencies. Assume that each
relation is obtained through decomposition from a relation with attributes
ABCDEFGHI and that all the known dependencies over relation ABCDEFGHI are
listed for each question. The options are independent of each other, obviously, since
the given dependencies over ABCDEFGHI are different. Which of the following
relation(s) is/are not in BCNF?
(a) R1(A, C, B, D, E), A → B, C → D
(b) R2(A, B, F), AB → F, B → F
(c) R3(A, D), A → D, D → A
(d) R4(D, C, H, G), D → H, C → G
Q81. Consider the relational schema R = {A, B, C, D} and the set of functional dependencies
FDs: {ABC → D, D → A}. The highest normal form satisfied by the relation R is
(a) 1NF (b) 2NF (c) 3NF (d) BCNF
Q83. [MSQ]
Suppose that we have the following four tuples in a relation S with three attributes
ABC: (1, 2, 3), (4, 2, 3), (5, 3, 3), (5, 3, 4). Which of the following multivalued (→→)
dependencies can you infer does hold over relation S?
(a) A →→ B (b) BC →→ A
(c) B →→ C (d) None of the above
Q84. Consider the following two schemas
Schema 1: R (A,B,C,D)
Schema 2: R1 (A,B,C) and R2 (B,D)
Which of the following statement(s) is/are true?
(a) If the Schema 1 have the only functional dependencies that hold on the relation are
A → B and C → D, then Schema 1 in BoyceCodd Normal Form (BCNF).
(b) If the Schema 2 have the only functional dependencies that hold on the relation are
A→B, A→ C, B→ A, A→D and all possible implicit FDs., then Schema 2 in
BoyceCodd Normal Form (BCNF).
(c) If the Schema 2 have the only functional dependencies that hold on the relation are
A→B, A→ C, B→ A and all possible implicit FDs., then Schema 2 in BoyceCodd
Normal Form (BCNF).
(d) None of the above
Q85. [MSQ]
Consider a relation R with five attributes ABCDE. Which of the following instance(s)
of R will never violated the FD: BC → D and the MVD: BC →→ D for the any value of
'a'?
(a) { } (i.e., empty relation)
(b) {(a,2,3,4,5), (2,a,3,5,5)}
(c) {(a,2,3,4,5), (2,a,3,5,5), (a,2,3,4,6)}
(d){(a,2,3,4,5), (2,a,3,4,5), (a,2,3,6,5)}
Q87. [MSQ]
Consider a table R(A, B, C, D). A set of attributes X is a super key if X + = ABCD, a set X
is a candidate key if X is a super key and no subset of X is a super key and a set X is
closed if X+ = X. Which of the following statement(s) is/are TRUE?
(a) If AB is a candidate key, then ABC cannot be closed.
(b) If AB is closed then ABC cannot be a key.
(c) If X, Y are closed then X ∪ Y is closed.
(d) If X, Y are closed then X ∩ Y is closed.
Q88. [MSQ]
Consider a relation R that contains r tuples with five attributes ABCDE. Assume that R
is decomposed into two smaller relations ABC and CDE. Let S be the relation ABC ⋈
CDE that contains s tuples. Assume that the decomposition is lossless, but not
dependency preserving. Which of the following statements can infer to be always true:
(a) r = s (b) r ⊆ s (c) r ⊇ s (d) r ≠ s
Q89. Consider an unordered file of 106 records with a record size of 100 bytes stored on
blocks of 4 Kbytes. We will assume that no system related information is stored within
a block. How many blocks we can save in storing the file using the spanned over the
unspanned record organization? ________
Q90. A data file consisting of 1,00,000 student-records is stored on a hard disk with block
size of 2048 bytes. The data file is sorted on the primary key RollNo. The size of a
record pointer for this disk is 9 bytes and block pointer is 6 bytes. Each student-record
has a candidate key attribute called Enroll_No. of size 12 bytes. Assume that the
records of data file and index file are not split across disk blocks. Suppose the
secondary index is built on the candidate key attribute of the file, and a multi-level
index scheme is used to store the secondary index, then the total number of blocks
required by the multilevel index is_______________
Q94. Suppose to improve access speed, we add a sparse index INDEX2 on INDEX1. After
building INDEX2 we want to find a record with a given id. In the worst-case scenario,
how many blocks must the system read to retrieve the contents of the (existing)
record? ______
Q96. Consider a disk with block size B = 1024 bytes. A block pointer is P = 6 bytes long, and
a record pointer is PR = 9 bytes long. A file has r = 1000,000 EMPLOYEE records of
fixed length. Each record is 128 bytes long and its key field is of size 9 bytes. The file is
unordered on a key field, and the file organization is unspanned. If the B-Tree access
structure is built on the key field of the file, then the total number of blocks required by
the B-Tree access structure is ______________
Q97. Consider a disk with block size B = 1024 bytes. A block pointer is P = 6 bytes long, and
a record pointer is PR = 9 bytes long. A file has r = 1000,000 EMPLOYEE records of
fixed length. Each record is 128 bytes long and its key field is of size 9 bytes. The file is
unordered on a key field, and the file organization is unspanned. If the B+-Tree access
structure is built on the key field of the file, then the total number of blocks required by
the B-Tree access structure is ______________
Q98. A database system maintains dense B-trees index on key field. Assume the following:
Block size: 4096 bytes.
Database record size: 300 bytes.
Block pointer: 10 bytes
Record pointer: 12 bytes.
Key field: 8 bytes.
The B-tree nodes are approximately 85% occupied.
The database has 1,000,000 rows
How many blocks will B-tree index (excluding data block) use? __________
Q99. Consider a B+ tree with order of non-leaf node is n and leaf node are n – 1 that has a
depth L > 1 (The depth of a node is the number of edges from the node to the tree's
root node and the depth of the root is 0). What is the maximum number of record
pointers the B+ tree can contain?
(a) nL × (n + 1) (b) n L – 1 × (n + 1)
(c) n L – 1 × (n – 1) (d) n L × (n – 1)
Q101. Construct a B+-tree of order 3 for the following set of key values: 2, 3, 5, 7, 11, 17, 19,
23, 29, and 31. Assume that the tree is initially empty and values are added in
ascending order. The total number of nodes in the B+-trees for the cases where the
number of pointers that will fit in one node is three? ______
Q102. Construct a B+-tree of order 4 for the following set of key values: 2, 3, 5, 7, 11, 17, 19,
23, 29, and 31. Assume that the tree is initially empty and values are added in
ascending order. The total number of nodes split in the construction of B+-trees for the
cases where the number of pointers that will fit in one node is four? ____________
Q103. Suppose you have a B+-tree with 3 levels (root at level 1) in which each node has
exactly 10 keys. There is a record for each key 1, 2, 3, . . ., N, where N is the number of
records. How many nodes must be examined to find all records with keys in the range
[95, 134]? _________
Q104. Consider the B+-tree index shown in the figure below. Each intermediate node can
hold up to five pointers and four key values. Each leaf can hold up to four records, and
leaf nodes are doubly linked as usual.
How many nodes that must be fetched to answer the following query: “Get all records
with search key greater than 38.”? ___________
What is the maximum number of keys you could insert that would NOT change the
height of the tree more than 1? __________
Q106. [MSQ]
Which of the following statements is/are incorrect?
(a) In ordered index, entries in the index file are stored on the search-key value.
(b) Clustering index is an ordered index whose search key defines the sequential order
of the file.
(c) An ordered sequential file with a primary index is called an index-sequential file
(d) The search key value must be the primary key of the file
Q107. [MSQ]
Which of the following statements about multilevel index is/are correct?
(a) If the primary index does not fit in memory, access becomes expensive.
(b) Outer index should be a sparse index of primary index.
(c) Indices at all levels are not necessarily updated on insertion or deletion from the
file.
(d) We can have a primary index with an index record for each search-key value.
Q110. If the SQL statement SELECT C1, C2, C3 FROM T4 WHERE C2='Smith' is frequently
executed, which column(s) should be considered for indexing based only on the
statement itself?
(a) C1 only (b) C2 only (c) C3 only (d) C1, C2, and C3
Q111. If the SQL statement SELECT R1.A, R2.B FROM R1, R2 WHERE R1.K = R2.F AND
R2.K = 10 is frequently executed, which indexes will prove most useful?
(a) Index on R1.K and index on R2.K
(b) Index on R1.A and index on R2.B
(c) Index on R1.K and index on R2.F
(d) Composite index on (R2.K, R2.F)
Q112. Consider a relation R (a, b, c, d) containing 1,000,000 records, where each page of the
relation holds 10 records. R is organized as a heap file with dense secondary indexes,
and the records in R are randomly ordered. Assume that attribute a is a candidate key
for R, with values lying in the range 0 to 999,999. Consider the list of approaches in
LIST - I and list of queries in LIST - II:
LIST - I LIST - II
1. Scanning through the whole heap i. Find all R tuples.
file for R. ii. Find all R tuples such that a < 50.
2. Using a B+ tree index on attribute iii. Find all R tuples such that a = 50.
R.a. iv. Find all R tuples such that a > 50 and
3. Using a hash index on attribute R.a. a < 100
Match the approach that would most likely require the fewest I/Os for processing the
queries.
(a) i – 1, ii – 2, iii – 3, iv – 2 (b) i – 1, ii – 2, iii – 3, iv – 3
(c) i – 3, ii – 2, iii – 3, iv – 2 (d) i – 2, ii – 2, iii – 3, iv – 3
Q114. Linear-probing hash table of length 10 uses the hash function h(x) =x mod 10 . After
inserting six integer keys into an initially empty hash table, the array of keys is:
0 1 2 3 4 5 6 7 8 9
42 23 34 52 46 33
Assume that the length of the hash table does not change during the insertions. Which
of the following choice(s) are insertion sequences resulting in the above hash table?
(a) 46, 42, 34, 52, 23, 33 (b) 34, 42, 23, 52, 33, 46
(c) 46, 34, 42, 23, 52, 33 (d) 42, 46, 33, 23, 34, 52
Q115. The hash function h(k) = k mod 7 and linear probing are used to insert keys < 37, 38,
72, 48, 98, 11, 56 > into the hash table with indices 0…6. The order of the keys in the
table are?
(a) 72, 11, 37, 38, 56, 98, 48, (b) 11, 48, 37, 38, 72, 98, 56
(c) 98, 11, 37, 38, 72, 56, 48 (d) 98, 56, 37, 38, 72, 11, 48
Q116. Suppose that the following keys are inserted into an initially empty linear-probing
hash table, but not necessarily in the order given
Assuming that the initial size of the hash table was 7 and that it did not grow or
shrink, how many possible keys from the given keys which could be the last inserted
key? ___________
And a reference graph is provided for your convenience. The dotted edges represent all
possible edges; each edge is labelled with the transaction IDs of the nodes it connects, in order.
e.g., the edge fromT4 → T1 is labelled 41.
Q121. Which of the following serial schedules are conflict equivalent to the schedule above?
(a) T4, T2, T1, T3 (b) T3, T2, T4, T1
(c) T3, T4, T2, T1 (d) T1, T2, T4, T3
Q122. Consider the transactions T1, T2, and T3 and the schedules S1 and S2 given below.
T1: r1(X); r1(Z); w1(X); w1(Z)
T2: r2(Y); r2(Z); w2(Z)
T3: r3(Y); r3(X); w3(Y)
S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z); w3(Y); w2(Z); r1(Z); w1(X); w1(Z)
S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z); r2(Z); w3(Y); w1(X); w2(Z); w1(Z)
Which one of the following statements about the schedules is TRUE?
(a) Only S1 is conflict-serializable.
(b) Only S2 is conflict-serializable.
(c) Both S1 and S2 are conflict-serializable.
(d) Neither S1 nor S2 is conflict-serializable.
Q123. [MSQ]
Which of the following is/are conflict serializable schedules?
(a) r1(x); r2(x); w1(x); r3(x); w2(x);
(b) r2(x); r1(x); w2(x); r3(x); w1(x);
(c) r3(x); r2(x); r1(x); w2(x); w1(x);
(d) r2(x); w2(x); r3(x); r1(x); w1(x);
Q124. [MSQ]
Given the following two schedules:
S1: r1(x); r2(x); w2(x); r3(x); w1(x); w2(y); r3(y); w3(x)
S2: r2(x); r1(x); w1(x); w2(x); w2(y); r3(x); w3(x); r3(y)
Which of the following statements is/are true?
(a) S1 and S2 are conflict equivalent.
(b) S1 and S2 are view equivalent.
(c) Both S1 and S2 are conflict serializable
(d) Both S1 and S2 are view serializable
Q126. Consider the following partial Schedule S involving two transactions T1 and T2.
Time T1 T2
t0 read(A);
t1 write(A);
t2 read(C);
t3 write(C);
t4 read(B);
t5 write(B);
t6 read(A);
t7 Commit;
t8 read(B)
Suppose that the transaction T1 fails immediately after time instance 8. Which one of
the following statements is correct?
(a) T2 must be aborted and then both T1 and T2 must be re-started to ensure
transaction atomicity
(b) Schedule S is non-recoverable and cannot ensure transaction atomicity
(c) Only T2 must be aborted and then re-started to ensure transaction atomicity
(d) Schedule S is recoverable and can ensure atomicity and nothing else needs to be
done.
Q127. Consider the following two transactions T1 and T2 involving data items A and B. The
values of A and B are initially 100 and 200 respectively.
T1: read(A); read(B); B = A + B; write(B);
T2: read(B); read(A); A = A − B; write(A);
Any non-serial interleaving of transactions T1 and T2 allowing concurrent execution
will lead to a serial that is
(a) Conflict equivalent to only T2, T1
(b) Conflict equivalent to only T1, T2
(c) Conflict equivalent to both the serial schedules
(d) Conflict equivalent to none of the serial schedules
ADVANCED DATABASE MANAGEMENT SYSTEM Page 44
Q128. [MSQ]
Consider the following schedule
Time T1 T2 T3
t0 Write(A);
t1 Read(B);
t2 Read(B);
t3 Write(A);
t4 Read(B);
t5 Write(C);
t6 Commit;
t7
t8 Write(B);
t9 Commit;
t10 Commit;
Which of the following statements is/are true regarding to above schedule?
(a) This schedule is possible under basic two-phase locking.
(b) This schedule is possible under strict two-phase locking.
(d) This schedule is possible under time stamp protocol.
(c) This schedule is free from cascading roll backing.
Q129. For the schedule S given below, if transaction T1 aborts after the last operation of
schedule S, then which of the following statements will be true?
S: r1(x); r2(z); w1(x); r3(x); r2(y); w2(y); w3(x); r3(y); r2(x)
(a) Only T3 will be rolled back.
(b) First T2 will be rolled back followed by T3 rollback.
(c) First T3 will be rolled back followed by T2 rollback.
(d) There will be no cascading rollbacks.
Q130. [MSQ]
Which of the following schedule is/are possible under basic 2PL?
(a) r1(A), w1(A), w2(B), w3(C), r1(D), w2(D);
(b) r3(A), w4(B), r1(C), r3(D), w3(B), w2(D), r3(A), w1(D), r3(B), r2(C), r1(A);
(c) r1(A), r2(B), w2(B), w1(A), c1, r2(A) w2(A), c2;
(d) None of the above
Q132. Conservative 2PL” is a variation of 2PL where transactions are required to lock all the
items before they start to access (both read and write) them. If any of the items cannot
be locked, the transaction does not lock any items and waits. Of the properties below,
check which ones are held by Conservative 2PL but not by 2PL:
(a) No conflicting actions in the schedule.
(b) No transaction aborts because of deadlock.
(c) Transactions that Ti reads from commit earlier than Ti
(d) none of the above
Q133. [MSQ]
Consider a schedule of three transactions, T1, T2, and T3 that access three database
elements, A, B, and C. The real time at which events occur increases down the page, as
usual. However, we have also indicated the timestamps of the transactions and the
read and write times of the elements. We assume that at the beginning, each of the
database elements has both a read and write time of 0. The timestamps of the
transactions are acquired when they notify the scheduler that they are beginning.
Notice that even though T1 executes the first data access, it does not have the least
Q134. Consider the following schedule under timestamp-based protocol, the protocol
allocates timestamps to transactions in the order of their starts. r1(A), r2(A), w1(B),
w2(B), What action the protocol will take for the last request?
(a) the request is accepted,
(b) the request is ignored,
(c) the transaction is delayed,
(d) the transaction is rolled back.
Q135. Consider the following schedule under timestamp-based protocol, the protocol
allocates timestamps to transactions in the order of their starts.
r2(A), co2, r1(A), w1(A)
What action the protocol will take for the last request?
(a) the request is accepted,
(b) the request is ignored,
(c) the transaction is delayed,
(d) the transaction is rolled back
Q137. Consider four transactions T1, T2, T3, and T4 operating on three data objects X, Y, and Z.
Let a Timestamp Ordering scheduler allow the following schedule of operations:
r1(X), r2(Y), w2(Z), r3(Z), r4(X), w4(Y), w3(Z), r1(Z), w1(Y). Let ts1, ts2, ts3, and ts4 be the
timestamps allocated by the Timestamp Ordering scheduler to the four transactions T 1,
T2, T3, and T4, respectively. Assume that the timestamps of X, Y, and Z are at or below
60 before the above schedule of operations is executed. identify in the list below the set
of timestamp values for the four transactions that will allow the schedule above.
(a) ts1 = 110, ts2 = 120, ts3 = 80, ts4 = 95.
(b) ts1 = 110, ts2 = 80, ts3 = 95, ts4 = 90.
(c) ts1 = 125, ts2 = 70, ts3 = 130, ts4 = 80.
(d) ts1 = 125, ts2 = 130, ts3 = 70, ts4 = 80.
Q138. [MSQ]
Consider a multi-granularity locking system, with lock modes S, X, IS, IX, SIX. The
object hierarchy is as follows: There is a root R, with blocks A and B under it. Block A
contains records a1 and a2, while block B contains records b1 and b2. Given below the
pair of locks identify the pair which are compatible. If a lock is on something other
than the root, assume that other suitable locks on parents have been taken, and
consider compatibility with those other locks as well. For example, S on B is
considered incompatible with X on b1, since the X on b1 will require IX on B. Which of
the following below condition(s) is/are possible?
(a) S on b1, X on B (b) IX on R, IX on R
(c) SIX on A, X on a2 (d) IS on A, S on a1
For the lock requests in above Table, which lock will be blocked by the lock manager?
(a) t1, t3, t4 (b)t2, t5 (c)t6, t7 (d) t3, t5
Q141. [MSQ]
Which of the following statements is/are true?
(a) Wound-wait always outperforms wait-die.
(b) If we know all records that each transaction will access, we can prevent deadlocks
by
imposing a total order on lock acquisitions.
(c) Wait-die always outperforms wound-wait.
(d) In general, locking uses fewer resources than optimistic methods that rely on
validation.
Q144. Consider the following statements based on the wait die scheme for deadlock
prevention:
1. Older transaction may wait for younger one to release data item. (older means
smaller timestamp).
2. Older transaction forces rollback of younger transaction instead of waiting for it.
Younger transactions may wait for older ones.
3. A transaction may die several times before acquiring needed data item.
4. It is non-preemptive scheme.
5. It is preemptive scheme.
The group of statements which are correct is
(a) 1, 3, 4 (b) 2, 5
(c) 1, 3, 5 (d) 2, 3, 4
Q149. [MSQ]
How many of the following statements is/are TRUE?
1. For any schedules S1 and S2, if S1 and S2 are conflict serializable, then S1 and S2 are
conflict equivalent.
2. A SIX lock is compatible with IS and IX locks, i.e. if a transaction holds a SIX lock
on an object, then another transaction can take an IS or IX lock on the same object.
3. An IX lock is compatible with an IS lock, i.e. if a transaction holds an IS lock on an
object, then another transaction can take an IX lock on the same object.
4. Strict 2PL prevents deadlocks.
5. In timestamp-based concurrency control, if a transaction gets aborted, it will be
restarted with a new timestamp.
(a) 1 (b) 2
(c) 3 (d) 4
Q151. [MSQ]
Which of the following statements is/are TRUE?
(a) Some conflict serializable schedules cannot be produced when using 2PL.
(b) Schedules that are conflict serializable will not produce a cyclic dependency graph.
(c) Both Strict 2PL and 2PL enforce conflict serializability.
(d) In Strict 2PL, we can give up locks after aborting but before rollback is complete
Q153. [MSQ]
Which of the following statements is /false?
(a) Blind writes appear in every view-serializable schedule that is not conflict
serializable.
(b) In serialization graph, an edge between two nodes exists if and only if the pair of
transactions corresponding to the nodes have conflicting operations.
(c) Every strict schedule is recoverable.
(d) Every view serializable schedule is recoverable.
Q154. [MSQ]
Which of the following statements is/are TRUE?
(a) Serializability ensures correctness of a schedule.
(b) A conflict serializable schedule is always equivalent to one and only one single
serial schedule.
(c) Every cascade-less schedule is recoverable.
(d) None of the above
Q155. [MSQ]
Which of the following statements is/are true?
(a) Under 2PL protocol, once a transaction releases a lock, it can no longer acquire any
new locks.
(b) Every conflict serializable can be produced by 2PL locking protocol.
(c) Schedules under 2PL are guaranteed to prevent cascading aborts.
(d) Strict two-phase locking is both necessary and sufficient to guarantee conflict
serializability.
Q157. If the database crashes immediately after writing the above log entries, then
subsequently performs recovery, which of the following statements is true:
(a) After a successful recovery, the state of X is 100.
(b) At the time of crash, the state of X (on disk) must be 42.
(c) At the time of crash, the state of Y (on disk) must be 20.
(d) After a successful recovery, the state of Z is 0.
Q161. Which one of the following options does not follow deferred database modification
scheme in the system crash situation?
(a) After system crash if there is no “commit T” instruction in log file then it requires
nothing to recover
(b) After system crash all transactions are redone in the backward order of their log
record (i.e., last log record first)
(c) No undo operations are required in the deferred database scheme.
(d) None of the above
Q162. Consider the simple nested-loop join of the following two relations r and s.
Assuming the worst-case memory availability, i.e., the memory can hold only one
block of each relation at a time, what is the number of block transfers? _______
Assuming the worst-case memory availability, i.e., the memory can hold only one
block of each relation at a time, what is the number of block transfers? _______
Data for the next two questions. Consider the following ER diagram:
Q165. [MSQ]
Which of the following statements is/are true?
(a) The relationship attribute “f” can be shifted to either entity set without losing any
information.
(b) The relationship attribute “f” can only be shifted to entity set A without losing any
information.
(c) The relationship attribute “f” can only be shifted to entity set B without losing any
information.
(d) The relationship attribute “f” cannot be shifted to either entity set without losing
any information.
Data for the next three questions. Consider the following ER diagram
Q166. How many tables will be created if we map this ER diagrams in to table? __________
Which one of the following problem descriptions could have led to the ER model
above?
(a) We are modeling a volleyball tournament. A volleyball game is played by two
teams. Multiple referees make sure during a single game that the rules are
respected.
(b) A volleyball game in a tournament is played by two teams. A referee has to be
present at each game to make sure the rules are respected.
(c) Two teams play volleyball in a tournament. In each game, one has the role of
“home” team and the other one has the role of “away” team. Each play is
supervised by at most one referee.
(d) None of the above
Q174. How many tables will be created if we map this ER diagrams in to table? ________
Q175. Which of the following is not the primary key of any table?
(a) (ISBN, CopyNr) (b) (ISBN, Catname)
(c) (ReaderNr, ISBN) (d) (ISBN)
Q176. Consider an Entity-Relationship (ER) model in which entity sets E1 and E2 are
connected by an M : N relationship R12. E2 and E3 are connected by a 1 : N (1 on the
side of E2 and N on the side of E3) relationship R23. E1 has three single-valued
attributes a11, a12 and a13 of which a11 is the key attribute. E2 has two single-valued
attributes a21 and a22 of which is a21 the key attribute. E3 has two single-valued
attributes a31 and a32, and one multi-valued attribute of which a31 is the key attribute.
The relationships do not have any attributes. If a relational model is the derived from
the above ER model, then the minimum number of relations that would be generated
if all the relations are in 3NF is ________
Q177. Consider the ER models 1 to 4 and the relational models (i) to (iv) given below. For
each ER model, there is a relational model that represents it correctly. Match the ER
models to it corresponding relational model.
If a relational model is the derived from the above ER model, then the total number of
attributes in all relations that would be generated if all the relations are in 3NF is
______
If a relational model is the derived from the above ER model, then the minimum
number of relations that would be generated if all the relations are in 3NF is ________
Q180. Consider the following Entity-Relationship (ER) model:
Other than the FD's that can be derived by ER diagram one more FD hold
Program, course# ⟶ cname
If we translate this ER diagram into table highest normal form satisfied by the schema
is
(a) 1 NF (b) 2 NF (c) 3 NF (d) BCNF
Q182. Consider the following E-R Diagram:
How many of the following conclusion can be inferred from the above diagram?______
(a) Each account must be associated with a bank branch.
(b) Each customer must have an account.
(c) Each loan must be owned by more than one customer, and each loan must be
associated with exactly one bank branch.
(d) A bank can have more than one branch.