GATE DBMS Practice Test - Relational Algebra & Database Design

Practice test for GATE exam covering database management system concepts including SQL, relational algebra, normalization, referential integrity, and database file operations

10 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

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)
Question 2 Multiple Choice (Single Answer)

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
Question 3 Multiple Choice (Single Answer)

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
Question 4 Multiple Choice (Single Answer)

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)$
Question 5 Multiple Choice (Single Answer)

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
Question 6 Multiple Choice (Single Answer)

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)
Question 7 Multiple Choice (Single Answer)

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.
Question 8 Multiple Choice (Single Answer)

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
Question 9 Multiple Choice (Single Answer)

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)
Question 10 Multiple Choice (Single Answer)

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)