Test 2 - Databases | Computer Science(CS)
Description: GATE Previous year Topic Wise Questions and Answers | Databases | |
Number of Questions: 27 | |
Created by: Aliensbrain Bot | |
Tags: Databases GATE CS |
Given relations r(w,x) and s(y,z), the result of select distinct w,x from r,s is guaranteed to be the same as r, provided
Suppose the adjacency relation of vertices in a graph is represented in a table Adj (X,Y). Which of the following queries cannot be expressed by a relational algebra expression of constant length?
Consider the following relation schema pertaining to a students database: Student (rollno, name, address) Enroll (rollno, courseno, coursename) where the primary keys are shown underlined. The number of tuples in the student and Enroll tables are 120 and 8 respectively. What are the maximum and minimum number of tuples that can be present in (Student*Enroll), where '*' denotes natural join?
Let r and s be two relations over the relation schemes R and S respectively, and let A be an attribute in R. Then the relational algebra expression $\sigma_A =_a (rs)$ is always equal to
Relation R is decomposed using a set of functional dependencies F and relation S is decomposed using another set of functional dependencies G. One decomposition is definitely BCNF, the other is definitely 3NF. To make a guaranteed identification, which one of the following tests should be used on the decompositions? (Assume that the closures of F and G are available).
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?
The relation scheme student Performance (name, courselNo, rollNo, grade) has the following functional dependencies: name, courseNo $\rightarrow$grade RollNo, courseNo$\rightarrow$grade name $\rightarrow$rollNo rollNo $\rightarrow$name The highest normal form of this relation scheme is
It is desired to design an object-oriented employee record system for a company. Each employee has a name, unique id and salary. Every employee belongs to different categories and his salary is determined by his category. The functions getName, getld and computeSalary are required. Given the class hierarchy below, possible locations for these functions are:
(i) getld is implemented in the superclass (ii) getld is implemented in the suclass (iii) getName is an abstract function in the superclass (iv) getName is implemented in the superclass (v) getName is implemented in the subclass (vi) getSalary is an abstract function in the superclass (vii) getSalary is implemented in the superclass (viii) getSalary is implemented in the subclass
Choose the best design
The order of an internal node in a B* tree index is the maximum number of children it can have. Suppose that a child pointer takes 6 bytes, the search field value takes 14 bytes and the block size is 512 bytes. What is the order of the internal node?
Consider the relation Student (name, sex, marks), where the primary key is shown underlined, pertaining to students in a class that has at least one boy and one girl. What does the following relational algebra expression produce?
Which of the following statements about normal forms is FALSE?
Consider the following relation instance.
X Y Z 1 4 2 1 5 3 1 6 3 3 2 2
Which of the following functional dependencies are satisfied by the instance?
Let E1 and E2 be two entities in an E-R diagram with simple single valued attributes. R1 and R2 are two relationships between E1 and E2 where R1 is one-to-many and R2 is many-to-many. R1 and R2 do not have any attributes of their own. What is the minimum number of tables required to represent this situation in relational model?
Which of the following relational calculus expressions is not safe?
The following table has two attributes A and C where A is the primary key and C is the foreign key referencing A with on-delete cascade.
The set of all tuples that must be additionally deleted to preserve referential integrity when the tuple (2,4) is deleted is:
From the following instance of relation schema R(A,B,C), we can conclude that
A B C 1 1 1 1 1 0 2 3 2 2 3 2
With regard to the expressive power of the formal relational query languages, which of the following statements is true?
Which one of the following is a key factor for preferring B+-trees to binary search trees for indexing database relation?
The employee information in a company is stored in the relation Employee (name, sex, salary, deptName) Consider the following SQL query select deptname from Employee where sex='M' group by deptName having avg (salary)> (select avg(salary)from Employee) It returns the names of the department in which
Consider a schema R(A,B,C,D) and functional dependencies A$\rightarrow$ B and C$\rightarrow$ D. Then the decomposition of R into R1(AB) and R2] (CD)g is
AB+-tree index is to be built on the Name attribute of the relation STUDENT. Assume that all student names are of length 8 bytes, disk blocks are of size 512 bytes, and index pointers are of size 4 bytes. Given this scenario, what would be the best choice of the degree (i.e. the number of pointers per node) of the B+-tree?
Consider a relation scheme R = (A,B,C,D,E,H) on which the following functional dependencies hold: {A $\rightarrow$ B, C $\rightarrow$ D, E $\rightarrow$ C, D $\rightarrow$ A}
What are the candidate keys of R?
R, (A, B, C, D) is a relation. Which of the following does not have a lossless join, dependency preserving BCNF decomposition?
Relation R with an associated set of functional dependencies, F is decomposed into BCNF. The redundancy (arising out of functional dependencies) in the resulting set of relations is
Consider a relation geq which represents “greater than or equal to”, that is, (x,y) $\epsilon$geq only if y $\le$ x: Create table gaq (Ib integer not null ub integer not null primary key Ib foreign key (ub) references geq on delete cascade):
Which of the following is possible if a tuple (x,y) is deleted?
The relation book (title, price) contains the titles and prices of different books. Assuming that no two books have the same price, what does the following SQL query select? select title from book as B where ( select count(*) from book as T where T. price>B.Price)<5
Given the relations employee (name, salary, deptno), and department (deptno, deptname, address). Which of the following queries cannot be expressed using the basic relational algebra operations ($\sigma, \pi, \cup, \cap -$)?