In SQL the statement select * from R, S is equivalent to
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:
SELECT *
FROM student JOIN takes USING (ID);
The above query is equivalent to
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?
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;
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?
Below query can be replaced by which one of the following?
Select name, course_id
from instructor, teaches
where instructor_ID= teaches_ID;
The ______ clause allows us to select only those rows in the result relation of the ____ clause that satisfy a specified predicate.
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
Select ________ dept_name
from instructor;
Here which of the following displays the unique values of the column?
The algorithm that takes a set of dependencies and adds one schema at a time, instead of decomposing the initial schema repeatedly is
R (A, B, C, D) is a relation. Which of the following does not have a lossless join dependency preserving BCNF decomposition?
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?
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
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