0

Online Test - 3 Database Management System

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

In SQL, a relation can contain null values, and comparisons with null values are treated as unknown. If all the comparisons with null values are treated as false, which of the following pairs is equivalent?

  1. x = 10 not (not x = 10)

  2. x = 10, x > 9 and x < 11, where x is an integer

  3. x $\ne$ 10 not (x = 10)

  4. Both (1) and (2)


Correct Option: D
Explanation:

null

If the strings of the language L can be effectively enumerated in lexicographic (i.e. alphabetic) order, which of the following statements is true?

  1. L is necessarily finite.

  2. L is regular but not necessarily finite.

  3. L is context free but not necessarily regular.

  4. L is recursive but not necessarily context free.


Correct Option: A
Explanation:

The strings of a language L can be effectively enumerated means a Turing machine exists for language L which will enumerate all valid strings of the language.If the string is in lexicographic order then TM will accept the string and halt in the final state. But, if the string is not lexicographic order then TM will reject the string and halt in non-final state.Thus, L is recursive language.We can not construct PDA for language L. So, the given language is not context free.

Which command is the fastest among the following?

  1. COPY TO < New File >

  2. COPY FILE < File 1 > < File 2 >

  3. COPY STRUCTRUE TO <new file >

  4. COPY TO M FILE - DAT DELIMITED


Correct Option: C

What happens when the structure of a database file, with 20 records, is modified?

  1. ? BOF ( ) Prints F

  2. ? EOF ( ) Prints F

  3. ? BOF ( ) Prints T

  4. ? EOF ( ) Prints T


Correct Option: D
Explanation:

When the structure of a database file, with 20 records, is modified it will become ? EOF ( ) Prints T

Consider the following SQL query

Select distinct $a_1, a_2, …, a_n$

from $r_1, r_2, …, r_m$

where P

For an arbitrary predicate P, this query is equivalent to which of the following relational algebra expressions?

  1. $\Pi_{a_1, a_2, … a_n} \sigma_p \left(r_1 \times r_2 \times \dots \times r_m\right)$

  2. $\Pi_{a_1, a_2, … a_n} \sigma_p \left(r_1 \bowtie r_2 \bowtie \dots \bowtie r_m \right)$

  3. $\Pi_{a_1, a_2, … a_n} \sigma_p \left(r_1 \cup r_2 \cup \dots \cup r_m \right)$

  4. $\Pi_{a_1, a_2, … a_n} \sigma_p \left(r_1 \cap r_2 \cap \dots \cap r_m \right)$


Correct Option: A
Explanation:

Cross product (x) combines the tuples of the one relation with all the tuples of other relation. Thus, tuples of relation $r_1, r_2 .... m$ are combined. Select operator $\sigma$ is used to select resultant tuples. Projection operator $ \pi _{a_1,a_2...a_n}$ is sued to select as subset of attributes from the resultant tuples by specifying the names of the attributes.

So attributes $a_1, a_2, $ an are projected from the resultant tuples.

Thus, option(A) is correct

In the Join of a relation P with a relation Q, P has 'm' tuples and Q has 'n' tuples. Then, the maximum and minimum sizes of the Join (respectively), are

  1. m + n and 0

  2. mn and 0

  3. m + n and |m - n|

  4. mn and m + n


Correct Option: B
Explanation:

The maximum size is possible when every tuple of r is combined with every tuple of S to get mn tuples. The minimum size is possible when no tuple of R is able to combine with any tuple of S.

Define languages L0 and L1 as follows: L0 = {M, w, 0 > 1 M halts on w} L0 = {M, w, 0 > 1 M does not halts on w} Here < M, u, I > is a triplet, whose first component M is an encoding of a Turing machine, second component, w, is a string and third component, I, is a bit Let L = L0$\cup$L1, which of the following is true?

  1. L is recursively enumerable, but $\bar L$is not.

  2. $\bar L$is recursively enumerable, but L is not.

  3. Both L and $\bar L$ are recursive.

  4. Neither L nor $\bar L$ is recursively enumerable.


Correct Option: A
Explanation:

null

Which of the following is a valid first order formula? (Here (\alpha) and (\beta) are first order formulae with $x$ as their only free variable)

  1. ((∀x)[α] ⇒ (∀x)[β]) ⇒ (∀x)[α ⇒ β]

  2. (∀x)[α] ⇒ (∃x)[α ∧ β]

  3. ((∀x)[α ∨ β] ⇒ (∃x)[α]) ⇒ (∀x)[α]

  4. (∀x)[α ⇒ β] ⇒ ((∀x)[α]) ⇒ (∀x)[β])


Correct Option: D
Explanation:

We know that, If the four tense operators, P, F, H and G and following axions are $G (Q\rightarrow R)\rightarrow (GQ \rightarrow GR)$ $H (Q\rightarrow R) \rightarrow (HQ\rightarrow HR)$ $G - HQ \rightarrow Q$ $- H - GQ\rightarrow Q$

Which normal form is not considered adequate for the normal relational database design?

  1. 2 NF

  2. 5 NF

  3. 3 NF

  4. Both (1) and (2)


Correct Option: D

Consider the following logic program P A(x) <- B(x, y), C(y) <- B(x,x) Which of the following first order sentences is equivalent to P?

  1. (∀x)[(∃y)[B(x,y)∧C(y)]⇒A(x)]∧¬(∃X)[B(x,x)]

  2. (∀x)[(∀y)[B(x,y)∧C(y)]⇒A(x)]∧¬(∃X)[B(x,x)]

  3. (∀x)[(∃y)[B(x,y)∧C(y)]⇒A(x)]∨¬(∃X)[B(x,x)]

  4. (∀x)[(∀y)[B(x,y)∧C(y)]⇒A(x)]∧(∃X)[B(x,x)]


Correct Option: C

Let R (a, b, c) and S (d, e, f) be the two relations in which d is the foreign key of S that refers to the primary key of R. Consider the following four operations regarding R and S; A. Insert into R B. Insert into S C. Delete from R D. Delete from S Which of the following is true about the above referential integrity constraint?

  1. None of these can cause its violation.

  2. All of these can cause its violation.

  3. Both (1) and (4) can cause its violation.

  4. Both (2) and (3) can cause its violation.


Correct Option: D

How much bandwidth is there in 0.2 micron of spectrum at a wavelength of 1 micron?

  1. 60,000 GHz

  2. 15,000 GHz

  3. 30,000 GHz

  4. 40,000 GHz


Correct Option: A
Explanation:

Using $\Delta f$ =$\dfrac{c \Delta \lambda}{\lambda^2}$, where $\Delta \lambda$ = 2 x 10-7 And      $\lambda$ = 10-6 $\Delta f$ = 60,000 GHz

Consider the following dependencies in a database:
Date_of_Birth$\rightarrow$Age Age$\rightarrow$Eligibility Name$\rightarrow$Roll_number Roll_number $\rightarrow$ Name Course_ number $\rightarrow$Courses_ name Course_ number$\rightarrow$Instructor (Roll_number; Courses_ name) $\rightarrow$Grade The relation (Roll_number, Name, Date_of_Birth, age) is

  1. in second normal form but not in third normal form

  2. in third normal form but not in BCNF

  3. in BCNF

  4. in none of the above


Correct Option: A
Explanation:

Given:  Date_of_Birth$\rightarrow$Age Age$\rightarrow$Eligibility Name$\rightarrow$Roll_number Roll_number $\rightarrow$ Name Course_ number $\rightarrow$Courses_ name Course_ number$\rightarrow$Instructor (Roll_number; Courses_ name) $\rightarrow$Grade For given relation: Date_of_Birth$\rightarrow$ Eligibility Course_ name$\rightarrow$ Instructor After observing we see that, it is not in 3rd normal form because in third normal form relation, every non-prime attribute is non transitively and fully dependent on the every candidate key. In 2nd normal form, all non - prime attributes are fully functionally dependent on the relation keys.

To have a file, which holds a list, it is necessary to

  1. identify the record in the list

  2. identify the name, width and type of the fields of each record

  3. identify the file in a record

  4. both (1) and (2)


Correct Option: D

Which of the following does not find all the customers who have a loan amount more than 1200?

  1. {t (Customer name) / t $\in$ borrow $\land$ t [amount] > 1200}

  2. {t / t(Customer name) $\in$ borrow $\land$ t [amount] > 1200}

  3. {t / $\exists$ s $\in$ borrow (t[Customer name] = s[Customer name]) $\land$ s[amount] > 1200)}

  4. Both (1) and (2)


Correct Option: D
Explanation:

The SQL statement is select customer. Customer name from customer, Borrow where Borrow Customer name = customer Customer name and Borrow. amount > 1200 Hence, relational calculus statement is {t / $\exists$ s $\in$ borrow (t[Customer name] = s[Customer name]) $\land$ s[amount] > 1200)}

- Hide questions