0

Online Test - 4 Database Management System

Description: GATE Online Exam Practice Test Database Management System (DBMS)
Number of Questions: 15
Created by:
Tags: DBMS GATE CS
Attempted 0/15 Correct 0 Score 0

Consider the NFA M shown below:

Let the language accepted by M be L. Let L1 be the language accepted by NFA M1, obtained by changing the accepting state of M to a non - accepting state and by changing the non - accepting state of M to accepting states. Which of the following statements is true?

  1. $L_1 = \{0, 1 \}^* - L$

  2. $L_1 = \{0, 1 \}$

  3. $L_1 \subseteq L $

  4. $L_1 = L $


Correct Option: B

Which of the following scenarios may lead to an irrecoverable error in a database system?

  1. A transaction writes a data item after it is read by an uncommitted transaction.

  2. A transaction reads a data item after it is read by an uncommitted transaction.

  3. A transaction reads a data item after it is written by a committed transaction.

  4. A transaction reads a data item after it is written by an uncommitted transaction.


Correct Option: D
Explanation:

Option 3 is a normal operation. Option 2 is also fine as no write operation is involved. Option 1 can be recovered, but option 4 can’t be.

What happens when a primary key is combined with a foreign key?

  1. It connects network model between the tables that connect them.

  2. It connects many-to-many relationship between the tables that connect them.

  3. It connects parent child relationship between the tables that connect them.

  4. None of these


Correct Option: C

The first element in T [5, 4] is

  1. 9

  2. 20

  3. 125

  4. 625


Correct Option: B

Consider the set of relations shown below and the SQL query that follows: Students: (Roll_ number, Name, Date_ of_ birth) Courses: (Course_ number, Course_ name, instructor) Grades: (Roll_ number, Course_number, grade) Select distinct name from students, courses, Grades where students. Roll_number = Grades. Roll_number and Courses. Instructor = Korth Courses. Courses_ number = Grades Courses_ number and Grades. grade = A

Which of the following sets is computed by the above query?

  1. Names of students who have got A grade in all courses taught by Korth.

  2. Names of students who have got A grade in all courses.

  3. Names of students who have got A grade in at least one of the courses taught by Korth.

  4. None of above


Correct Option: C
Explanation:

The query gives the name of all the students who have scored “A” grade in any of the courses that are taught by Korth. So, 3 is the correct choice.

Which of the following does the database administrator coordinate?

  1. DBMS and data base

  2. Application program and data base

  3. Data base and users

  4. Application program and users


Correct Option: C

A relational database, which is in 3NF, may have undesirable data redundancy because there may exist

  1. non-trivial functional dependencies involving prime attributes on the right side

  2. non -trivial functional dependencies involving only prime attributes

  3. either (1) or (2)

  4. both (1) and (2)


Correct Option: D

Consider two languages $L_1$ and $L_2$ each on the alphabet $\Sigma$. Let $f : \Sigma^* → \Sigma^*$ be a polynomial time computable bijection such that $(\forall x) [ x\in L_1$ iff $f(x) \in L_2]$. Further, let $f^{-1}$ be also polynomial time computable.

Which of the following CANNOT be true?

  1. $L_1$ $\in P$ and $L_2$ is finite

  2. $L_1$ $\in NP$ and $L_2$ $\in P$

  3. $L_1$ is undecidable and $L_2$ is decidable

  4. $L_1$ is recursively enumerable and $L_2$ is recursive


Correct Option: C
Explanation:

We have one to one mapping for all instances of L1 to L2. L1 is given to be undecidable. Further L1 is polynomial time reducible to L2. (By given mapping). Now if L2 is decidable then there is algorithm to solve L2 in polytime. But then we can solve every instance of L1 in polytime, making L1 also decidable. Contradiction  

Bit rate for transmitting compressed VGA colour, with 7 bits/pixel at 40 frames/sec, is

  1. 53.7 Mbps

  2. 63.7 Mbps

  3. 73.7 Mbps

  4. 64.51 Mbps


Correct Option: D
Explanation:

Number of bits / sec $\approx$ 640 × 480 × 30 × 7 or 64.51 Mbps

The following resolution rule is used in logic programming. Derive clause (P ∨ Q) from clauses (P ∨ R), (Q ∨ ¬R) Which of the following statements related to this rule is FALSE?

  1. ((P ∨ R) ∧ (Q ∨ ¬R)) ⇒ (P ∨ Q) is logically valid

  2. (P ∨ Q) ⇒ ((P ∨ R)) ∧ (Q ∨ ¬R)) is logically valid

  3. (P ∨ Q) is satisfiable if and only if (P ∨ R) ∧ (Q ∨ ¬R) is satisfiable

  4. (P ∨ Q) ⇒ FALSE if and only if both P and Q are unsatisfiable


Correct Option: B
Explanation:

If P = True, Q = False, R = True Then, we find (T$\cup F$)$\Rightarrow$(T$\cup$T) $\land$(F$\cup$F) T$\Rightarrow$(T$\land$F) T$\Rightarrow$F F$\cup$F False is not valid.

Which of the following definitions does not generate the same language as L? L = {XnYn, n $\ge$ 1} I. E $\rightarrow$ XEY | XY II. XY | X + XYY+ III. X + Y +

  1. I only

  2. I and II

  3. II and III

  4. II only


Correct Option: C

Which of the following relationship calculus-expressions is not safe?

  1. $\left\{t \mid \exists u \in R_1\left(t[A] = u[A]\right) \land \neg \exists s \in R_2 \left(t[A] = s[A]\right)\right\}$

  2. $\left\{t \mid \neg (t \in R_1)\right\} $

  3. $\left\{t \mid \exists u \in R_1\left(t[A]=u[A]\right) \land \exists s \in R_2 \left(t[A] = s[A]\right)\right\}$

  4. Both (1) and (3) are safe.


Correct Option: D

Consider a relation geq, which represents “greater than or equal to”, i.e. (x, y)$\in$ geq only if y > = x. Create table geq: ( lb integer not null ub integer not null primary key lb foreign key (ub) references geq on delete cascade )

If a tuple (x, y) is deleted, which of the following is possible?

  1. A tuple (z, w), with z > y is deleted.

  2. A tuple (z, w), with z > x is deleted.

  3. A tuple (z, w), with w < x is deleted.

  4. The deletion of (x, y) is prohibited.


Correct Option: C
Explanation:

In the above question, the relation schema is ( lb , ub ), where lb is the primary key, and ub is the foreign key which is referencing the primary key of its own relation. Hence the table geq is both the master ( which has the referenced key ) as well as the child table (which has the referencing key). The table has two constraint, one is that if there is a tuple ( x, y ), then y is greater than or equal to x, And the other is referential integrity constraint, which is on-cascade-delete on the foreign key. On-cascade-delete says, that “When the referenced row is deleted from the other table (master table), then delete also from the child table”. Suppose the instance in the given relation is the following:

x  y

5  6 4  5 3  4 6  6 Now if we delete tuple (5,6) then tuple ( 4,5 ) should also be deleted ( as 5 in the tuple (4, 5) was referencing to 5 in the tuple(5,6) which no longer exist, hence the referencing tuple should also be deleted), and as (4,5) got deleted hence tuple (3,4) should also be deleted for the same reason. Therefore in total 3 rows have to be deleted if tuple ( 5,6 ) is deleted. Now from the above instance we can say that if (x,y), i.e. ( 5,6 ) gets deleted then a tuple ( z, w) i.e, ( 3, 4) is also deleted. And we can see here that w < x. Hence option 3.

These are five records in a data base:

     
Name Age Occupation Category
Neha 23 CON A
Dhruti 24 ENG B
Sonika 25 DOC C
Poonam 26 SER D

There is an index file associated with this and it contains the values: 1, 3, 2, 4. Which of the following fields is the index built form?

  1. Age

  2. Name

  3. Occupation

  4. Category


Correct Option: C

Given relations: $\gamma$ (w, x) and S (y, z), the result of select distinct w, x. From r, S is guaranteed to be the same as $\gamma$, empty. Which among the following is correct?

  1. $\gamma$ has no duplicates and s is non empty.

  2. $\gamma$ and s have no duplicates.

  3. S has no duplicates and $\gamma$ is non empty.

  4. $\gamma$ and S have the same number of tuples.


Correct Option: A
- Hide questions