adplus-dvertising
frame-decoration

Question

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?

a.

Both I and II

b.

I only

c.

II only

d.

Neither I nor I

Posted under DBMS

Answer: (a).Both I and II

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. 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...

Similar Questions

Discover Related MCQs

Q. 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;

Q. 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?

Q. 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?

Q. The normal form which satisfies multivalued dependencies and which is in BCNF is

Q. Which of the following is a tuple-generating dependencies ?

Q. The main task carried out in the __________ is to remove repeating attributes to separate tables.

Q. Which of the normal form is based on multivalued dependencies ?

Q. Which forms has a relation that possesses data about an individual entity?

Q. If a multivalued dependency holds and is not implied by the corresponding functional dependency, it usually arises from one of the following sources.

Q. Which of the following has each related entity set has its own schema and there is an additional schema for the relationship set?

Q. In which of the following , a separate schema is created consisting of that attribute and the primary key of the entity set.

Q. Fifth Normal form is concerned with

Q. In 2NF

Q. _____________ can help us detect poor E-R design.

Q. Which of the following has each related entity set has its own schema and there is an additional schema for the relationship set.

Q. Suppose the user finds the usage of room number and phone number in a relational schema there is confusion.This is reduced by

Q. What is the best way to represent the attributes in a large database?

Q. Designers use which of the following to tune performance of systems to support time-critical operations?

Q. In the schema (dept name, size) we have relations total inst 2007, total inst 2008 . Which dependency have lead to this relation ?

Q. Relation dept year(dept name, total inst 2007, total inst 2008, total inst 2009) .Here the only functional dependencies are from dept name to the other attributes .This relation is in