Which query would give the required result?

View the Exhibit and examine the data in the PROJ_TASK_DETAILS table.

The PROJ_TASK_DETAILS table stores information about tasks involved in a project and the
relation between them.
The BASED_ON column indicates dependencies between tasks. Some tasks do not depend on
the completion of any other tasks.
You need to generate a report showing all task IDs, the corresponding task ID they are dependent
on, and the name of the employee in charge of the task it depends on.
Which query would give the required result?

View the Exhibit and examine the data in the PROJ_TASK_DETAILS table.

The PROJ_TASK_DETAILS table stores information about tasks involved in a project and the
relation between them.
The BASED_ON column indicates dependencies between tasks. Some tasks do not depend on
the completion of any other tasks.
You need to generate a report showing all task IDs, the corresponding task ID they are dependent
on, and the name of the employee in charge of the task it depends on.
Which query would give the required result?

A.
SELECT p.task_id, p.based_on, d.task_in_charge
FROM proj_task_details p JOIN proj_task_details d
ON (p.based_on = d.task_id);

B.
SELECT p.task_id, p.based_on, d.task_in_charge
FROM proj_task_details p LEFT OUTER JOIN proj_task_details d ON (p.based_on = d.task_id);

C.
SELECT p.task_id, p.based_on, d.task_in_charge
FROM proj_task_details p FULL OUTER JOIN proj_task_details d ON (p.based_on = d.task_id);

D.
SELECT p.task_id, p.based_on, d.task_in_charge
FROM proj_task_details p JOIN proj_task_details d
ON (p.task_id = d.task_id);



Leave a Reply 4

Your email address will not be published. Required fields are marked *


David

David

B is not the right answer because it returns this:

SELECT p.task_id, p.based_on, d.task_in_charge
FROM proj_task_details p LEFT OUTER JOIN proj_task_details d ON (p.based_on = d.task_id); 2

TAS BAS TASK_
— — —–
P02 P01 KING
P04 P03 GREEN
P03
P01

What is requested is actually more something like:

select task_id, based_on, task_in_charge from proj_task_details;

That is why correct answer is D:

SELECT p.task_id, p.based_on, d.task_in_charge
FROM proj_task_details p JOIN proj_task_details d
ON (p.task_id = d.task_id); 2 3

TAS BAS TASK_
— — —–
P01 KING
P02 P01 KOCHA
P03 GREEN
P04 P03 SCOTT

Ekta

Ekta

B is correct.
We have to return the name of the employee corresponding to the task depends on i.e (based on)

SO PO2 PO1 King shud b retruned

and not PO2 PO1 KOchar

Eamon

Eamon

@Ekta, you are right. B is the right answer.

@David, please note that the question does state
“and the name of the employee in charge of the task it depends on”

karthiga

karthiga

C option, using full outer join also gives same result, right?