Which two statements are true regarding the USING and ON clauses in table joins? (Choose two.)
A.
Both USING and ON clauses can be used for equijoins and nonequijoins.
B.
A maximum of one pair of columns can be joined between two tables using the ON clause.
C.
The ON clause can be used to join tables on columns that have different names but compatible data types.
D.
The WHERE clause can be used to apply additional conditions in SELECT statements containing the ON or the USING clause.
i don’t think “D” is right. Any comment?
From the SQL Fundamentals I
Applaying Additional Conditions to a Join.
” To add additional conditions to the ON clause, you can add AND clauses. Alternatively, you can use a WHERE clause to applay additional conditions.”
Hello Justyna can u plz reply to my queries my exam is on 16 aug 2013
C,D
Can someone explain me why Answer A it’s incorrect? Thnaks!
“A” is incorrect because USING only performs equijoins.
SELECT foo
FROM MyTable
JOIN YourTable USING (foo_id);
The syntax offers no opportunity to specify an operator; the operator is always equality.
Why Answer ‘A’ is incorrect?
SQL> SELECT ENAME,DNAME FROM EMP E JOIN DEPT D
2 ON E.DEPTNO=D.DEPTNO;
ENAME DNAME
———- ————–
CLARK ACCOUNTING
KING ACCOUNTING
MILLER ACCOUNTING
JONES RESEARCH
FORD RESEARCH
ADAMS RESEARCH
SMITH RESEARCH
SCOTT RESEARCH
WARD SALES
TURNER SALES
ALLEN SALES
ENAME DNAME
———- ————–
JAMES SALES
BLAKE SALES
MARTIN SALES
14 rows selected.
SQL> SELECT ENAME,DNAME FROM EMP E JOIN DEPT D
2 ON E.DEPTNO=D.DEPTNO
3 WHERE ENAME=’CLARK’;
ENAME DNAME
———- ————–
CLARK ACCOUNTING