github

Made bySaurav Hathi

CSE - Practice Test -25

Q1:

In SQL the statement select * from R, S is equivalent to

Tags:
Section:
Databases
Options:
Q2:

Which join refers to join records from the right table that have no matching key in the left table are include in the result set:

Tags:
Section:
Databases
Options:
Q3:

SELECT *
FROM student JOIN takes USING (ID);

The above query is equivalent to

Tags:
Section:
Databases
Options:
Q4:

Suppose now that R(A,B) and S(A,B) are two relations with r and s tuples, respectively (again, not necessarily distinct). If m is the number of (not necessarily distinct) tuples in the result of the SQL query:

R intersect S;

Then which of the following is the most restrictive, correct condition on the value of m?

Tags:
Section:
Databases
Options:
Q5:

Suppose relation R(A,B) currently has tuples {(1,2), (1,3), (3,4)} and relation S(B,C) currently has {(2,5), (4,6), (7,8)}. Then the number of tuples in the result of the SQL query:

SELECT *

FROM R NATURAL OUTER JOIN S;

Tags:
Section:
Databases
Options:
Q6:

Suppose we wish to find the ID’s of the employees that are managed by people who are managed by the employee with ID 123. Here are two possible queries:

I.SELECT ee.empID
FROM Emps ee, Emps ff
WHERE ee.mgrID = ff.empID AND ff.mgrID = 123;
II.SELECT empID
FROM Emps 
WHERE mgrID IN
(SELECT empID FROM Emps WHERE mgrID = 123);

Which, if any, of the two queries above will correctly (in SQL2) get the desired set of employee ID’s?

Tags:
Section:
Databases
Options:
Q7:

Below query can be replaced by which one of the following?

Select name, course_id
from instructor, teaches
where instructor_ID= teaches_ID;

Tags:
Section:
Databases
Options:
Q8:

The ______ clause allows us to select only those rows in the result relation of the ____ clause that satisfy a specified predicate.

Tags:
Section:
Databases
Options:
Q9:

Let R(A,B,C,D,E,P,G) be a relational schema in which the following FDs are known to hold:

AB->CD

DE->P

C->E

P->C

B->G

The relation schema R is

Tags:
Section:
Databases
Options:
Q10:

Select ________ dept_name
from instructor;
Here which of the following displays the unique values of the column?

Tags:
Section:
Databases
Options:
Q11:

The algorithm that takes a set of dependencies and adds one schema at a time, instead of decomposing the initial schema repeatedly is

Tags:
Section:
Databases
Options:
Q12:

R (A, B, C, D) is a relation. Which of the following does not have a lossless join dependency preserving BCNF decomposition?

Tags:
Section:
Databases
Options:
Q13:

Suppose relation R(A,B,C,D,E) has the following functional dependencies:

A -> B
B -> C
BC -> A
A -> D
E -> A
D -> E

Which of the following is not a key?

Tags:
Section:
Databases
Options:
Q14:

There are two functional dependencies with the same set of attributes on the left side of the arrow:
A->BC
A->B
This can be combined as

Tags:
Section:
Databases
Options:
Q15:

Inst_dept (ID, name, salary, dept name, building, budget) is decomposed into

instructor (ID, name, dept name, salary)
department (dept name, building, budget)

This comes under

Tags:
Section:
Databases
Options: