You are on page 1of 10

DBMS Mock Test

Q1. There are two relations NIC2020(exam-date, exam_center, branch-id)


and Candidate (rollno, name, bid, refno, choice_of_date). In a
Candidate relation, bid is the foreign key which refers to the key of
NIC2020. Suppose an insertion into Candidate relation and deletion
from NIC2020 relation is done, then which of the following statement
is true?
(a) Insertion into Candidate relation can cause inconsistency.
(b) Deletion from NIC2020 relation can cause inconsistency.
(c) Both operations can cause inconsistency.
(d) None of them can cause inconsistency of data.

Q2. Which of the following operators can be used between main query and
sub query?
(a) IN/Not IN
(b) BETWEEN
(c) LIKE
(d) IS NULL
Q3. Consider the following ER diagram:

Which of the following is correct attribute set for one of the minimized
RDBMS table for above ER diagram?
(a) E1 (ACB) with AC is key
(b) E1 (ACEF) with ACE is key
(c) R (AE) with AE is key
(d) S (AC) with AC is key

Q4.
Q5. The minimum number of keys in a B+ tree is 3. What is the maximum
number of keys in any non-root node?
(a) 5
(b) 6
(c) 7
(d) 8

Q6. Given relation R (A, B, C, D, E) and set of functional dependencies


F= {AB → C, AB → D, D → A, BC → D, BC → E}
The highest normal form satisfied by R is_______
(a) 1NF
(b) 2NF
(c) 3NF
(d) BCNF

Q7. In ER-model, weak entity meets which of the following conditions.


(a) Weak entity is existence dependent i.e. Weak entity cannot exist without
the entity with which it has a relationship.
(b) Weak entity has a primary key that is partially or totally derived from
the parent entity in the relationship.
(c) Both (a) and (b)
(d) Neither (a) nor (b)

Q8. 2PL guarantee serializability, but it does not prevent deadlocks. 2PL
has two phases: Growing and Shrinking.
Which of the following rules are used to govern the 2PL protocol?
(a) Two transactions cannot have conflicting locks.
(b) No unlock operation can precede a lock operation in the same
transaction.
(c) No data are affected until all locks are obtained i.e, until the transaction
is in its locked point.
(d) All of these

Q9. Consider the following relations R and S


R S
A B C B C D
1 2 3 2 3 10
4 5 6 2 3 11
7 8 9 6 7 12
6 8 10

Find the number of tuples in R ⟕ S. [left outer join]


(a) 3
(b) 4
(c) 5
(d) 6

Q10. A block can hold either 6 records or 12 key pointers. A database


contains 48 records, then how many blocks is required to hold the data
file and the dense index?
(a) 6
(b) 8
(c) 12
(d) 18
Q11. Consider the following E-R diagram

Q12. Consider the relations R(A, B) and S(B, C). Which one of the
following can evaluate differently than the others?
(a)  (R) − ((R −  (R ⋈ S)))
(b)  (R  ((R)   (S)))
(c)  ((R  C(S))  ((R  S))
(d)  (R ⋈ S)
Q13. Consider the following schedules:
S1: R2(A), R1(C), R2(B), W2(B), R3(B), R1(A), R3(C), W3(C), W1(A)
S2: R2(A), R1(C), R2(B), R3(B), W2(B), R1(A), R3(C), W3(C), W1(A)
Which of the above schedules are conflict-serializable?
(a) S1 only
(b) S2 only
(c) Both S1 and S2
(d) Neither S1 nor S2

Q14. Consider a relation R(A, B, C, D, E) with functional dependencies


AB→C, C→D, D→ D→E
How many candidate keys exist in R?
(a) 2
(b) 3
(c) 4
(d) 5

Q15. Consider a table T in a relational database with a key field k. A B-tree


of order P is used as an access structure on k, where P denotes the
maximum number of tree pointers in a B-tree index node. Assume that
k is 10 bytes long, disk block size is 512 bytes, each data pointer P D is
8 bytes long and each block pointer PB is 5 bytes long in order for each
B tree node to fit in a single disk block, the maximum value of P is
(a) 20
(b) 22
(c) 23
(d) 32
Q16. Consider a relation with 3 attributes. How many maximum candidate
keys could it have at most the same time?
(a) 1
(b) 2
(c) 3
(d) 4

Q17. A bank database contains three relations Client, Account and


Depositor as shown below

How many tuples will be present in response to the following query.


(Client_city, Client_pin) (Client)  (Client_name) (Depositor)

(a) 28
(b) 29
(c) 30
(d) 32
Q18. A bank database contains three relations Client, Account and
Depositor as shown below

How many tuples will be result of the following query?

(a) 2
(b) 4
(c) 5
(d) None of these
Q19. Consider the relation R with the following information R(A, B, C, D)

Choose the invalid non-trivial functional dependencies from the given


options?
(a) BC → A, BC → D

(b) CD → A, AD → C

(c) BD → A, ACD → B

(d) ABC → D, ABD → C

Q20. Assume that Ti requests a lock held by Tj. The following table
summarizes the actions taken for wait-die and wound-wait scheme:

Fill correct status of Ti and Tj at W, Y, X, and Z respectively.


(a) Ti dies, Ti waits, Ti waits, and Tj aborts respectively.
(b) Ti dies, Ti waits, Ti waits, and Tj aborts respectively
(c) Ti waits, Ti dies, Ti waits, and Tj aborts respectively
(d) None of these

You might also like