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
Questions
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?
- x = 10 not (not x = 10)
- x = 10, x > 9 and x < 11, where x is an integer
- x $\ne$ 10 not (x = 10)
- Both (1) and (2)
Which command is the fastest among the following?
- COPY TO < New File >
- COPY FILE < File 1 > < File 2 >
- COPY STRUCTRUE TO <new file >
- COPY TO M FILE - DAT DELIMITED
What happens when the structure of a database file, with 20 records, is modified?
- ? BOF ( ) Prints F
- ? EOF ( ) Prints F
- ? BOF ( ) Prints T
- ? 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?
- $\Pi_{a_1, a_2, … a_n} \sigma_p \left(r_1 \times r_2 \times \dots \times r_m\right)$
- $\Pi_{a_1, a_2, … a_n} \sigma_p \left(r_1 \bowtie r_2 \bowtie \dots \bowtie r_m \right)$
- $\Pi_{a_1, a_2, … a_n} \sigma_p \left(r_1 \cup r_2 \cup \dots \cup r_m \right)$
- $\Pi_{a_1, a_2, … a_n} \sigma_p \left(r_1 \cap r_2 \cap \dots \cap r_m \right)$
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
- m + n and 0
- mn and 0
- m + n and |m - n|
- mn and m + n
Which normal form is not considered adequate for the normal relational database design?
- 2 NF
- 5 NF
- 3 NF
- Both (1) and (2)
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?
- None of these can cause its violation.
- All of these can cause its violation.
- Both (1) and (4) can cause its violation.
- Both (2) and (3) can cause its violation.
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
- in second normal form but not in third normal form
- in third normal form but not in BCNF
- in BCNF
- in none of the above
To have a file, which holds a list, it is necessary to
- identify the record in the list
- identify the name, width and type of the fields of each record
- identify the file in a record
- both (1) and (2)
Which of the following does not find all the customers who have a loan amount more than 1200?
- {t (Customer name) / t $\in$ borrow $\land$ t [amount] > 1200}
- {t / t(Customer name) $\in$ borrow $\land$ t [amount] > 1200}
- {t / $\exists$ s $\in$ borrow (t[Customer name] = s[Customer name]) $\land$ s[amount] > 1200)}
- Both (1) and (2)