Database Management System

DBMS Questions Answers GATE 2022

Database Management System (DBMS) GATE Question Answers with Explanation.
Q1 – In a relational data model, which one of the following statements is TRUE? (GATE 2022)
  1. A relation with only two attributes is always in BCNF.
  2. If all attributes of a relation are prime attributes, then the relation is in BCNF.
  3. Every relation has at least one non-prime attribute.
  4. BCNF decompositions preserve functional dependencies.

Ans – (1)

Explanation

Q2 – Consider the following three relations in a relational database.
Employee(eId, Name), Brand(bId, bName), Own(eId, bId)
Which of the following relational algebra expressions return the set of eIds who own all the brands? (GATE 2022)
  1. πeId ( πeId, bId (Own) / πbId (Brand))
  2. πeId(Own) – πeId Iid (Own) / πbId (Brand)) – πeId, bId (Own))
  3.  πeId ( πeId, bId (Own) / πbId (Own))
  4.  πeId ( πeId, bId (Own) x πbId (Own)/ πbId (Brand))

Ans – (1, 2)

Explanation

Q3 – Which of the following statements is/are TRUE with respect to deadlocks? (GATE 2022)

 

  1. Circular wait is a necessary condition for the formation of deadlock.
  2. In a system where each resource has more than one instance, a cycle in its wait-for graph indicates the presence of a deadlock.
  3. If the current allocation of resources to processes leads the system to unsafe state, then deadlock will necessarily occur.
  4. In the resource-allocation graph of a system, if every edge is an assignment edge, then the system is not in deadlock state.

Ans – (1, 4)

Explanation – 

Q4 – Consider a relation R(A, B, C, D, E) with the following three functional dependencies.
𝐴𝐵 → 𝐶; 𝐵𝐶 → 𝐷; 𝐶 → 𝐸;
The number of superkeys in the relation R is _____________. (GATE 2022)

Ans – (8)

Explanation

Q5 – Let Ri(z) and Wi(z) denote read and write operations on a data element z by a transaction Ti, respectively. Consider the schedule S with four transactions.
S: R4(x)R2(x)R3(x)R1(y)W1(y)W2(x)W3(y)R4(y)
Which one of the following serial schedules is conflict equivalent to S? (GATE 2022)
(A) 𝑇1 → 𝑇3 → 𝑇4 → 𝑇2
(B) 𝑇1 → 𝑇4 → 𝑇3 → 𝑇2
(C) 𝑇4 → 𝑇1→ 𝑇3 → 𝑇2
(D) 𝑇3 → 𝑇1 → 𝑇4 → 𝑇2

Ans – (1)

Explanation

Q6 – Consider the relational database with the following four schemas and their respective instances.
Student(sNo, sName, dNo) Dept(dNo, dName)
Course(cNo, cName, dNo) Register(sNo, cNo)
Student Database GATE 2022
SQL Query:
SELECT * FROM Student AS S WHERE NOT EXIST
      (SELECT cNo FROM Course WHERE dNo = “D01”
            EXCEPT
       SELECT cNo FROM Register WHERE sNo = S.sNo)
The number of rows returned by the above SQL query is___________. (GATE 2022)

Ans – (2)

Explanation