exam questions

Exam 1z0-071 All Questions

View all questions & answers for the 1z0-071 exam

Exam 1z0-071 topic 1 question 41 discussion

Actual exam question from Oracle's 1z0-071
Question #: 41
Topic #: 1
[All 1z0-071 Questions]

Examine the description of the EMPLOYEES table:

Which two queries return rows for employees whose manager works in a different department? (Choose two.)
A.

B.

C.

D.

E.

Show Suggested Answer Hide Answer
Suggested Answer: BE

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
NI_maruf
1 year, 6 months ago
Can anyone please explain why option E is the right answer here? why not C?
upvoted 1 times
ogi33
6 months, 2 weeks ago
C may contain employees without a mamager , that is, the bosa of the bosses ;)
upvoted 1 times
...
Lydia1054
1 year, 6 months ago
To the E part. AND is part of JOIN and it is RIGHT JOIN, so in the left table (emp) only the result meet the condition emp.manager_id = mgr.employee_id and mgr.department_id <> emp.department_id will show up in the left table; otherwise will be NULL. Therefore, adding WHERE to filter the NULL out of the result.
upvoted 1 times
...
Lydia1054
1 year, 6 months ago
C has to change AND to WHERE then the result will be correct. Use AND then the emp.department_id <> mgr.department_id is part of the JOIN and it will show all the rows in the left table, it not filter out any rows.
upvoted 1 times
...
Shrimathi
1 year, 6 months ago
create table emp(emp_id number,dept_id number,manager_id number); insert all into emp values(1,5,50) into emp values(2,5,50) into emp values(3,5,5) into emp values(50,5,null) into emp values(5,4,null) select * from dual; commit; select e.* from emp e right join emp m on e.manager_id=m.emp_id and e.dept_id<>m.dept_id where e.emp_id is not null; output: 3 5 5 E is correct, since it is mentioned e.employee_id is not null Right out join it will return matched row of both table and unmatch row that is all row from the emp m table. e.emp_id is not null this condition retrieves only the employee whose manager works in different department.
upvoted 3 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago