Database Management System

DBMS Questions Answers GATE 2021

Database Management System (DBMS) GATE Question Answers with Explanation.
Q1 – Suppose a database system crashes again while recovering from a previous crash. Assume checkpointing is not done by the database either during the transactions or during recovery. Which of the following statements is/are correct?

 

  1. The same undo and redo list will be used while recovering again
  2. The system cannot recover any further
  3. All the transactions that are already undone and redone will not be recovered again
  4. The database will become inconsistent

Ans – (1)

Explanation –

Q2 – A relation r(A,B) in a relational database has 1200 tuples. The attribute A has integer values ranging from 6 to 20, and the attribute B has integer values ranging from 1 to 20. Assume that the attributes A and B are independently distributed. The estimated number of tuples in the output of σ(A>10)∨(B=18)(r) is ____________.

Ans – (819 to 820) OR (205)

Explanation –

Q3 – The following relation records the age of 500 employees of a company, where empNo (indicating the employee number) is the key: 
DBMS EMP Query 1 GATE 2021
Consider the following relational algebra expression: 
DBMS EMP Query 2 GATE 2021
What does the above expression generate?
  1. Employee numbers of only those employees whose age is the maximum
  2. Employee numbers of only those employees whose age is more than the age of exactly one other employee
  3. Employee numbers of all employees whose age is not the minimum
  4. Employee numbers of all employees whose age is the minimum.

Ans – (3)

Explanation – 

Q4 – Let ri(z) and wi(z) denote read and write operations respectively on a data item z by a transaction Ti.
Consider the following two schedules.
S1:  r1(x)r1(y)r2(x)r2(y)w2(y)w1(x)
S2:  r1(x)r2(x)r2(y)w2(y)r1(y)w1(x)

 

Which one of the following options is correct?

 

  1. S1 is conflict serializable, and S2 is not conflict serializable.
  2. S1 is not conflict serializable, and S2 is conflict serializable.
  3. Both S1 and S2 are conflict serializable.
  4. Neither S1 nor S2 is conflict serializable.

Ans – (2)

Explanation – 

Q5 – Consider the relation R(P,Q,S,T,X,Y,Z,W) with the following functional dependencies. 
Functional Dependency 1 GATE 2021
Consider the decomposition of the relation R into the constituent relations according to the following two decomposition schemes. 

Decomposition 1 GATE 2021

Which one of the following options is correct?
  1. D1 is a lossless decomposition, but D2 is a lossy decomposition
  2. D1 is a lossy decomposition, but D2 is a lossless decomposition
  3. Both D1 and D2 are lossless decompositions
  4. Both D1 and D2 are lossy decompositions

Ans – (1)

Explanation – 

Q6 – A TCP server application is programmed to listen on port number P on host S. A TCP client is connected to the TCP server over the network.
Consider that while the TCP connection was active, the server machine S crashed and rebooted.
Assume that the client does not use the TCP keepalive timer. Which of the following behaviours is/are possible?

 

  1. If the client was waiting to receive a packet, it may wait indefinitely
  2. The TCP server application on S can listen on P after reboot
  3. If the client sends a packet after the server reboot, it will receive a RST segment
  4. If the client sends a packet after the server reboot, it will receive a FIN segment.

Ans – (1, 2, 3)

Explanation – 

Q7 – Consider two hosts P and Q connected through a router R. The maximum transfer unit (MTU) value of the link between P and R is 1500 bytes, and between R and Q is 820 bytes. A TCP segment of size 1400 bytes was transferred from P to Q through R, with IP identification value as 0×1234. Assume that the IP header size is 20 bytes. Further, the packet is allowed to be fragmented, i.e., Don’t Fragment (DF) flag in the IP header is not set by P. Which of the following statements is/are correct?

 

  1. Two fragments are created at R and the IP datagram size carrying the second fragment is 620 bytes.
  2. If the second fragment is lost, R will resend the fragment with the IP identification value 0×1234.
  3. If the second fragment is lost, P is required to resend the whole TCP segment.
  4. TCP destination port can be determined by analysing only the second fragment.

Ans – (1, 3)

Explanation –Â