0

Online Test 1 - Database Management system

Description: GATE Online test for practice Database Management system DBMS
Number of Questions: 17
Created by:
Tags: DBMS GATE CS
Attempted 0/17 Correct 0 Score 0

In a particular schedule, transaction T2 reads a value previously written by transaction T1 and transaction T3 reads a value previously written by T2. Which of the following ensures the schedule to be cascade less schedule?

  1. T1 commits before T2 and T2 commits before T3.

  2. T1 commits after T2 and T2 commits before write operation of T3.

  3. T1 commits before T2 and T2 commits before write operation of T3.

  4. T1 commits at last and T2 and T3 can commit in any order.


Correct Option: A

Relation R with an associated set of functional dependencies, F is decomposed in to BCNF. The redundancy in the resulting set of relation is

  1. zero

  2. more than zero but less than that of an equivalent SNF decomposition

  3. proportional to the size of $F^t$

  4. indeterminate


Correct Option: A
Explanation:

null

For relation R(ABCDE), the given FD's are A$\rightarrow$BC, BC$\rightarrow$E and E$\rightarrow$DA, similarly S be a relation with attributes ABCDE and with FD's A$\rightarrow$BC, B$\rightarrow$E and E$\rightarrow$DA. Which among R and S are in BCNF?

  1. R only

  2. S only

  3. Both of these

  4. Neither of these


Correct Option: C
Explanation:

null

Consider the following: $r(R):$r is a relation with attribute R $s(S):$s is a relation with attribute S $|x|:$denotes natural join operation X: denotes Cartesian product operation Then $r|xs=r \times s|:$ if

  1. $R \cap S = R$

  2. $R \cup S = S$

  3. $R \cap S = \phi$`

  4. none of these


Correct Option: C
Explanation:

null

With regard to the expressive power of the former relational query language, which of the following statements is true?

  1. Relational algebra is more powerful than relational calculus.

  2. Relational algebra has the same power as relational calculus.

  3. Relational algebra has the same power as safe relational calculus.

  4. None of the above


Correct Option: C
Explanation:

A query can be formulated in relational calculus if and only if it can be formulated in relational algebra. So, relational algebra has the same power as relational calculus.But, it is possible to write syntactically correct relational calculus queries that have infinite number of answers. Such queries are unsafe. Queries that have an finite number of answers are safe relational calculus queries.Thus, Relational algebra has the same power as safe relational calculus. Thus, option (3) is the answer.

Set F of functional dependencies for relation schema R(A, B, C, D, E) is A$\rightarrow$BC, CD$\rightarrow$E, B$\rightarrow$D, E$\rightarrow$A. Determine the number of candidate's keys for R.

  1. 2

  2. 3

  3. 4

  4. 5


Correct Option: C
Explanation:

Candidate's keys are A, BC, CD, E.

Given R(A,B, C, D, E) and $ F = \{ B \rightarrow, AB \rightarrow C, CD \rightarrow E \} \text{ and } D = \{BE, ABDE\}$be decomposition. What is the highest normal form of decomposition D?

  1. 1 NF

  2. 2 NF

  3. 3 NF

  4. BCNF


Correct Option: A
Explanation:

null

Given R(A,B, C, D, E) and $ F = \{ B \rightarrow, AB \rightarrow C, CD \rightarrow E \} \text{ and } D = \{BE, ABDE\}$be decomposition.

What is the highest normal form of R?

  1. 1 NF

  2. 2 NF

  3. 3 NF

  4. BCNF


Correct Option: A
Explanation:

null

Consider the following relation R (A, B, C, D, E, F) with FD set A$\rightarrow$BCDEF BC$\rightarrow$ADEF B$\rightarrow$F D$\rightarrow$E The highest normal form achieved by R is

  1. 1 NF

  2. 2 NF

  3. 3NF

  4. BNCF


Correct Option: B
Explanation:

A, BC are keys B$\rightarrow$F violates the 2NF definition.

Consider the schema R = (S, T, U, V) and dependencies S$\rightarrow$T, T$\rightarrow$U, U$\rightarrow$V and V$\rightarrow$S. Let R$R = \{ R_1 \text{ and } R_2 \}$be a decomposition such that $R_1 \cap R_2 = \phi$. The decomposition is

  1. not in 2NF

  2. in 2NF but not in 3NF

  3. in 3NF but not in 2NF

  4. in both 2NF and 3NF


Correct Option: D

Let r(R) and s(S) be relations and let $S \le R$, the division operation R/S can be expressed as

  1. $\pi_{R-S}(R)$

  2. $\pi_{R-S}(R)-\pi_{R-S}((\pi_{R-S}(r)\times S) - \pi_{R-S}S(r))$

  3. $\pi_{R-S}(R)((\pi_{R-S}(r)\times S) - \pi_{R-S}S(r))$

  4. $\pi_{R-S}(r)\times S:$


Correct Option: B
Explanation:

By definition of division operator

Consider the relation schema: Parts (Pno, pname) Supplier (Sid, Sname) SP (sid, pno, qty) The SQL query which display all the parts having more than one supplier is

  1. select distinct p.pname from parts P, SP a, SP b where a.Pno = b.Pno and a.Sid = b.sid and a.Pno = P.pno

  2. select distinct P.name from parts P, SP a, SP b where a.pno = b.pno and a.sid < > b.sid and P.Pno = a.Pno

  3. cannot be determined

  4. none of these


Correct Option: B

Consider a relation: R(A, B, C, D) with FD A$\rightarrow$BCD BC$\rightarrow$AD D$\rightarrow$B The highest normal form achieved by R is

  1. 1 NF

  2. 2 NF

  3. 3 NF

  4. BCNF


Correct Option: C
Explanation:

A, BC and CD are keys. So, FD D$\rightarrow$B violates BCNF definition. Hence, highest normal form is 3 NF.

Suppose a schedule with two transactions $T_1 \&amp; T_2$:

$T_1$ $T_2$
Read (A)
Write (A)
Read (A) commit
Read (A) commit

The above schedule is

  1. cascade less schedule

  2. recoverable schedule

  3. irrecoverable schedule

  4. none of these


Correct Option: C

Consider the following schedule: $R_1(A,B), R_2(B,C), R_3(B,C), V_1, V_2, V_3, W_1(A), W_3(C)$, where R stands for reads, W stands for write and V for validation. What will happen if above schedule is checked and is tested under optimistic concurrency control protocol?

  1. $T_1$ roll will be backed.

  2. $T_2$ roll will be blocked.

  3. $T_3$ roll will be backed.

  4. Successful completion will be there.


Correct Option: D
Explanation:

First find out read and write set of each transaction and then apply validation algorithm.

Let $R_1 \left(\underline{A}, B, C\right)$ and $R_2\left(\underline{D}, E \right) $ be two relation schema, where the primary keys are shown underlined, and let C be a foreign key in $R_1$ referring to $R_2$. Suppose there is no violation of the above referential integrity constraint in the corresponding relation instances $r_1$ and $r_2$. Which of the following relational algebra expressions would necessarily produce an empty relation?

  1. $\Pi_D (r_2) - \Pi_C (r_1)$

  2. $\Pi_C (r_1) - \Pi_D (r_2)$

  3. $\Pi_D \left(r_1 \bowtie_{C \neq D}r_2\right)$

  4. $\Pi_C \left(r_1 \bowtie_{C = D}r_2\right)$


Correct Option: C
Explanation:

$\Pi_C (r_1) - \Pi_D (r_2) = null$

The total number of function dependencies (both trivial and non trivial) that can be formed over relation having degree = n are

  1. $2^n$

  2. $2^{2n}$

  3. $n!$

  4. $2+n!$


Correct Option: B
Explanation:

If R(A, B) ie n = 2

$\left \{ A, B \\ AB, \phi \right\} \rightarrow \left \{ A, b \\ AB, \phi \right\}$ $2^n \times 2^n = 2^{2n}$

- Hide questions