DBMS GATE previous year questions with answer
Ques 14 Gate 2017 Set-2
An ER model of a database consists of entity types A and B. These are connected by a relationship R which does not have its own attribute. Under which of the following conditions, can the relational table for R be merged with that of A?
(A) Relation R is one-to-many and the participation of A in R is total.
(B) Relation R is one-to-many and the participation of A in R is partial.
(C) Relation R is many-to-one and the participation of A in R is total.
(D) Relation R is many-to-one and the participation of A in R is partial.
Ques 15 Gate 2017 Set-1
In a database system, unique time stamps are assigned to each transaction using Lamport’s logical clock. Let TS(T1) and TS(T2) be the time stamps of transactions T1 and T2 respectively. Besides, T1 holds a lock on the resource R, and T2 has requested a conflicting lock on the same resource R. The following algorithm is used to prevent deadlocks in the database assuming that a killed transaction is restarted with the same timestamp.
T1 is killed
else
T2 waits.
.
Assume any transactions that is not killed terminates eventually. Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks?
PROCESSED
Ques 16 Gate 2017 Set-1
Consider a database that has the relation schemas EMP (EmpId, EmpName, DepId), and DEPT(DeptName, DeptId). Note that the DepId can be permitted to be NULL in the relation EMP. Consider the following queries on the database expressed in tuple relational calculus.
II. {t | ∃ u ∈ EMP (t[EMPName] = u[EmpName] ∧ ∃ v ∈ DEPT (t[DeptId] ≠ DeptId]))}
III. {t | ∃ u ∈ EMP (t[EMPName] = u[EmpName] ∧ ∃ v ∈ DEPT (t[DeptId] = DeptId]))}
Ques 17 Gate 2017 Set-1
The following functional dependencies hold true for the relational schema R{V, W, X, Y, Z}:
VW→X
Y→VX
Y→Z
Which of the following is irreducible equivalent for this set of functional dependencies?
Ques 18 Gate 2016 Set-2
Consider the following database schedule with two transactions, T1 and T2.
S = r2(X); r1(X); r2(Y); w1(X); r1(Y); w2(X); a1; a2;
where ri(Z) denotes a read operation by transaction Ti on a variable Z, wi(Z) denotes a write operation by Ti on a variable Z and ai denotes an abort by transaction Ti . Which one of the following statements about the above schedule is TRUE?
PROCESSED
Ques 19 Gate 2016 Set-2
Suppose a database schedule S involves transactions T1, ....Tn. Construct the precedence graph of S with vertices representing the transactions and edges representing the conflicts. If S is serializable, which one of the following orderings of the vertices of the precedence graph is guaranteed to yield a serial schedule?
PROCESSED
Ques 20 Gate 2016 Set-1
Consider the following two phase locking protocol. Suppose a transaction T accesses (for read or write operations), a certain set of objects {O1,...,Ok}. This is done in the following manner:
Step 1. T acquires exclusive locks to O1,...,Ok in increasing order of their addresses.
Step 2. The required operations are performed.
Step 3. All locks are released.
This protocol will
Given:
A protocol where a transaction acquires exclusive locks on objects in increasing order of their addresses.
All required operations are executed after getting the locks.
All locks are released after the operations are completed.
To find:
Whether this protocol guarantees serializability and/or deadlock-freedom.
Solution:
First, let me check the locking and unlocking phases.
All locks are acquired in Step 1, and no lock is released until Step 3.
Since all lock requests precede all unlock requests, this protocol follows the Two-Phase Locking (2PL) rule.
I know that any 2PL protocol guarantees conflict serializability.
Now let me check the deadlock condition.
Here, transactions acquire locks on items strictly in increasing order of their addresses.
This creates a global total ordering on all resources.
Because every transaction requests objects according to the same global order, circular wait is impossible.
Since circular wait cannot happen, deadlock can never occur.
So this protocol guarantees both serializability and deadlock-freedom.
Answer: (A) guarantee serializability and deadlock-freedom
Ques 21 Gate 2016 Set-1
A database of research articles in a journal uses the following schema.
(VOLUME, NUMBER, STARTPGE, ENDPAGE, TITLE, YEAR, PRICE)
The primary key is (VOLUME, NUMBER, STARTPAGE, ENDPAGE) and the following functional dependencies exist in the schema.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> TITLE
(VOLUME, NUMBER) -> YEAR
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> PRICE
The database is redesigned to use the following schemas.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, PRICE)
(VOLUME, NUMBER, YEAR)
Which is the weakest normal form that the new database satisfies, but the old one does not?
Given:
Original schema: R(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, YEAR, PRICE)
Primary Key: (VOLUME, NUMBER, STARTPAGE, ENDPAGE)
Functional Dependencies:
FD1: (VOLUME, NUMBER, STARTPAGE, ENDPAGE) → TITLE
FD2: (VOLUME, NUMBER) → YEAR
FD3: (VOLUME, NUMBER, STARTPAGE, ENDPAGE) → PRICE
Redesigned schemas:
R1(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, PRICE)
R2(VOLUME, NUMBER, YEAR)
To find:
The weakest normal form that the new database satisfies, but the old one does not.
Solution:
First, let me analyze the normal form of the original schema R.
The candidate key for R is (VOLUME, NUMBER, STARTPAGE, ENDPAGE).
So the prime attributes are: VOLUME, NUMBER, STARTPAGE, ENDPAGE.
The non-prime attributes are: TITLE, YEAR, PRICE.
Looking at FD2: (VOLUME, NUMBER) → YEAR.
Here, (VOLUME, NUMBER) is a proper subset of the candidate key, and YEAR is a non-prime attribute.
This means there is a partial dependency, so R violates 2NF.
Thus, the original schema is only in 1NF.
Now, let me check the redesigned schemas.
For relation R1:
The candidate key is (VOLUME, NUMBER, STARTPAGE, ENDPAGE).
The functional dependencies are:
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) → TITLE
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) → PRICE
In both FDs, the left-hand side is a superkey. So R1 is in BCNF.
For relation R2:
The candidate key is (VOLUME, NUMBER).
The functional dependency is:
(VOLUME, NUMBER) → YEAR
Here too, the left-hand side is a superkey. So R2 is in BCNF.
Since both R1 and R2 are in BCNF, the new database satisfies 2NF, 3NF, and BCNF.
The old database does not satisfy 2NF, 3NF, or BCNF.
Among the normal forms that the new database satisfies but the old one does not (2NF, 3NF, BCNF), the weakest one is 2NF.
Answer:
(B) 2NF
Ques 22 Gate 2016 Set-1
Which one of the following is NOT a part of the ACID properties of database transactions?
Given:
Four properties related to database transactions: Atomicity, Consistency, Isolation, and Deadlock-freedom.
To find:
The property that is NOT a part of the ACID properties.
Solution:
Let me recall what the acronym ACID stands for in database systems.
A stands for Atomicity, meaning all operations in a transaction succeed, or none do.
C stands for Consistency, ensuring the database moves from one valid state to another.
I stands for Isolation, ensuring concurrent transactions do not interfere with each other.
D stands for Durability, ensuring that committed changes are saved permanently.
Now looking at the options, Deadlock-freedom is given for letter D instead of Durability.
So Deadlock-freedom is definitely not an ACID property.
Answer: (D) Deadlock-freedom
Ques 23 Gate 2016 Set-1
Which of the following is NOT a superkey in a relational schema with attributes V, W, X, Y, Z and primary key V Y ?
Given:
Relation schema attributes = {V, W, X, Y, Z}
Primary key = V Y
To find:
Which of the given options is NOT a superkey.
Solution:
Okay, let's recall the basic definition of a superkey.
A superkey is simply any set of attributes that contains a candidate key (or primary key) as a subset.
Here, the primary key is given as {V, Y}.
So, any attribute set that contains both V and Y will act as a superkey.
Now let me check each option one by one.
Checking option A: {V, X, Y, Z}.
It contains both V and Y, so this is a superkey.
Checking option B: {V, W, X, Z}.
Wait, Y is missing here! It only has V, not Y.
Since it does not contain the primary key {V, Y}, it cannot be a superkey.
Let me just quickly check the remaining options to be sure.
Checking option C: {V, W, X, Y}.
Contains both V and Y, so it is a superkey.
Checking option D: {V, W, X, Y, Z}.
Contains both V and Y, so it is also a superkey.
Therefore, option B is definitely not a superkey.
Answer: (B)
Total Unique Visitors