[August 2019 edition] OCP 071 certification test original topic - 33 questions

Choose three.

Which three statements are true about a self join?

A) It must be an inner join.

B) It can be an outer join.

C) The ON clause must be used.

D) It must be an equijoin.

E) The query must use twodifferent aliases for the table.

F) The ON clause can be used.

Answer::BCD

(Analysis: the left is actually connected to the left outer join, are just different names, the result is the same, ANSI syntax grammar left connected, and the oracle syntax using (+) to represent.)

select emp.empno,emp.deptno,dept.deptno,dept.dname

from emp left join dept on emp.deptno=dept.deptno;

select emp.empno,emp.deptno,dept.deptno,dept.dname

from emp left outer join dept on emp.deptno=dept.deptno;

select emp.empno,emp.deptno,dept.deptno,dept.dname

from emp ,dept

where emp.deptno=dept.deptno(+)

Guess you like

Origin blog.51cto.com/13854012/2451733